summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorArsen Arsenović2023-02-21 20:20:31 +0100
committerDenys Vlasenko2023-02-27 13:09:44 +0100
commit2d4a3d9e6c1493a9520b907e07a41aca90cdfd94 (patch)
tree43346d952c6bab88c456802246d9531f67907127 /scripts
parent029740a3e43835d2a71696449baba5250a346e0a (diff)
downloadbusybox-2d4a3d9e6c1493a9520b907e07a41aca90cdfd94.zip
busybox-2d4a3d9e6c1493a9520b907e07a41aca90cdfd94.tar.gz
fixdep: avoid underflow when end of entry doesn't coincide with EOF
Bug: https://bugs.gentoo.org/893776 Closes: https://bugs.busybox.net/show_bug.cgi?id=15326 Signed-off-by: Arsen Arsenović <arsen@gentoo.org> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/basic/fixdep.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
index 426b488..66be73a 100644
--- a/scripts/basic/fixdep.c
+++ b/scripts/basic/fixdep.c
@@ -338,6 +338,11 @@ void parse_dep_file(void *map, size_t len)
do p--; while (!isalnum((unsigned char)*p));
p++;
}
+ if (p < m) {
+ /* we've consumed the last filename of this list
+ already. */
+ break;
+ }
memcpy(s, m, p-m); s[p-m] = 0;
if (strrcmp(s, "include/autoconf.h") &&
strrcmp(s, "arch/um/include/uml-config.h") &&