aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiu Aleaxander <Aleaxander@gmail.com>2009-05-25 10:56:19 +0800
committerLiu Aleaxander <Aleaxander@gmail.com>2009-05-25 10:56:19 +0800
commitca5116774bdb3d203e2db68736b3645023d50a43 (patch)
tree2f8514deca1dede6e25ff6839bde4e61e9b20e2b
parent0bf5aa38d3b2574e5963c7e5f3843d09390b155b (diff)
downloaddevel-ca5116774bdb3d203e2db68736b3645023d50a43.tar.gz
devel-ca5116774bdb3d203e2db68736b3645023d50a43.tar.xz
devel-ca5116774bdb3d203e2db68736b3645023d50a43.zip
fix the dirsearch bug
-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);