aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--isolinux.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/isolinux.c b/isolinux.c
index cb83f10..30bff71 100644
--- a/isolinux.c
+++ b/isolinux.c
@@ -15,7 +15,7 @@
#include <stdio.h>
#include <string.h>
-#include <malloc.h>
+
#define DEBUG 1
@@ -427,6 +427,9 @@ int do_search_dir(struct dir_t *dir, char *name, void **res)
file_pos += de_len;
}
+ if ( file_pos >= dir->dir_len )
+ return 0; /* not found */
+
if ( *(name+de_name_len) && (*(name+de_name_len) != '/' ) ) {
printf("Something wrong happened during searching file %s\n", name);