mirror of
https://review.haiku-os.org/haiku
synced 2024-11-23 15:28:58 +01:00
UserlandFS: avoid crash if module is not found.
If we can't find the name in the module list, we would try to dereference the NULL pointer which terminates that list.
This commit is contained in:
parent
5b1f411f57
commit
28627b28aa
@ -398,7 +398,7 @@ userlandfs_create_file_system(const char* fsName, image_id image,
|
||||
|
||||
// find the module
|
||||
file_system_module_info* module = NULL;
|
||||
for (int32 i = 0; modules[i]->name; i++) {
|
||||
for (int32 i = 0; modules[i] && modules[i]->name; i++) {
|
||||
if (strcmp(modules[i]->name, moduleName) == 0) {
|
||||
module = (file_system_module_info*)modules[i];
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user