diff options
| author | Mike Frysinger <vapier@gentoo.org> | 2006-12-30 19:21:48 +0000 |
|---|---|---|
| committer | Mike Frysinger <vapier@gentoo.org> | 2006-12-30 19:21:48 +0000 |
| commit | c255f8b492ea8309b7f554aa2814545efa67fa58 (patch) | |
| tree | bcd94ce62f41bf371e0b363b60574fe13e56b85e /scripts/basic | |
| parent | 6a5dc5d75a1368464fc7e085aa1f1d4c453d27cd (diff) | |
| download | busybox-w32-c255f8b492ea8309b7f554aa2814545efa67fa58.tar.gz busybox-w32-c255f8b492ea8309b7f554aa2814545efa67fa58.tar.bz2 busybox-w32-c255f8b492ea8309b7f554aa2814545efa67fa58.zip | |
prevent accessing memory that we dont own
Diffstat (limited to 'scripts/basic')
| -rw-r--r-- | scripts/basic/fixdep.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index df3446e35..2fa78ee6a 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c | |||
| @@ -231,10 +231,10 @@ void parse_config_file(char *map, size_t len) | |||
| 231 | int off; | 231 | int off; |
| 232 | 232 | ||
| 233 | for (; p < end; p++) { | 233 | for (; p < end; p++) { |
| 234 | if (!memcmp(p, "CONFIG_", 7)) goto conf7; | 234 | if (p<end-7 && !memcmp(p, "CONFIG_", 7)) goto conf7; |
| 235 | if (!memcmp(p, "ENABLE_", 7)) goto conf7; | 235 | if (p<end-7 && !memcmp(p, "ENABLE_", 7)) goto conf7; |
| 236 | if (!memcmp(p, "USE_", 4)) goto conf4; | 236 | if (p<end-4 && !memcmp(p, "USE_", 4)) goto conf4; |
| 237 | if (!memcmp(p, "SKIP_", 5)) goto conf5; | 237 | if (p<end-5 && !memcmp(p, "SKIP_", 5)) goto conf5; |
| 238 | continue; | 238 | continue; |
| 239 | conf4: off = 4; goto conf; | 239 | conf4: off = 4; goto conf; |
| 240 | conf5: off = 5; goto conf; | 240 | conf5: off = 5; goto conf; |
| @@ -303,7 +303,7 @@ void parse_dep_file(void *map, size_t len) | |||
| 303 | char *p; | 303 | char *p; |
| 304 | char s[PATH_MAX]; | 304 | char s[PATH_MAX]; |
| 305 | 305 | ||
| 306 | p = strchr(m, ':'); | 306 | p = memchr(m, ':', len); |
| 307 | if (!p) { | 307 | if (!p) { |
| 308 | fprintf(stderr, "fixdep: parse error\n"); | 308 | fprintf(stderr, "fixdep: parse error\n"); |
| 309 | exit(1); | 309 | exit(1); |
