aboutsummaryrefslogtreecommitdiffstats
path: root/com32
diff options
context:
space:
mode:
Diffstat (limited to 'com32')
-rw-r--r--com32/lib/sys/module/common.c2
-rw-r--r--com32/lib/sys/module/elf_module.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/com32/lib/sys/module/common.c b/com32/lib/sys/module/common.c
index deb2bcc8..8547036b 100644
--- a/com32/lib/sys/module/common.c
+++ b/com32/lib/sys/module/common.c
@@ -425,7 +425,7 @@ int _module_unload(struct elf_module *module) {
int module_unload(struct elf_module *module) {
module_ctor_t *dtor;
- for (dtor = module->dtors; *dtor; dtor++)
+ for (dtor = module->dtors; dtor && *dtor; dtor++)
(*dtor) ();
return _module_unload(module);
diff --git a/com32/lib/sys/module/elf_module.c b/com32/lib/sys/module/elf_module.c
index c4e9d410..e61480f5 100644
--- a/com32/lib/sys/module/elf_module.c
+++ b/com32/lib/sys/module/elf_module.c
@@ -604,7 +604,7 @@ int module_load(struct elf_module *module) {
(module->exit_func == NULL) ? NULL : *(module->exit_func));
*/
- for (ctor = module->ctors; *ctor; ctor++)
+ for (ctor = module->ctors; ctor && *ctor; ctor++)
(*ctor) ();
return 0;