Changed some error handling a bit.
diff --git a/loader/pe_image.c b/loader/pe_image.c
index fc26c8a..5910589 100644
--- a/loader/pe_image.c
+++ b/loader/pe_image.c
@@ -211,8 +211,11 @@
assert(end-forward<256);
strncpy(module, forward, (end - forward));
module[end-forward] = 0;
- wm = MODULE_FindModule( module );
- assert(wm);
+ if (!(wm = MODULE_FindModule( module )))
+ {
+ ERR_(win32)("module not found for forward '%s'\n", forward );
+ return NULL;
+ }
return MODULE_GetProcAddress( wm->module, end + 1, snoop );
}
return NULL;
@@ -238,8 +241,7 @@
/* first, count the number of imported non-internal modules */
pe_imp = pem->pe_import;
- if (!pe_imp)
- ERR_(win32)("no import directory????\n");
+ if (!pe_imp) return 0;
/* We assume that we have at least one import with !0 characteristics and
* detect broken imports with all characteristsics 0 (notably Borland) and
@@ -252,6 +254,7 @@
break;
i++;
}
+ if (!i) return 0; /* no imports */
/* Allocate module dependency list */
wm->nDeps = i;