From: Andy Green Date: Wed, 2 May 2007 19:48:37 +0000 (+0200) Subject: [PATCH] kbuild: fixdep segfault on pathological string-o-death X-Git-Tag: v2.6.20.14~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=58a25fc96840baa5a6e0a15a0089919e2d96cfc9;p=thirdparty%2Fkernel%2Fstable.git [PATCH] kbuild: fixdep segfault on pathological string-o-death build scripts: fixdep blows segfault on string CONFIG_MODULE seen The string "CONFIG_MODULE" appearing anywhere in a source file causes fixdep to segfault. This string appeared in the wild in the current mISDN sources (I think they meant CONFIG_MODULES). But it shouldn't segfault (esp as CONFIG_MODULE appeared in a quoted string). Signed-off-by: Andy Green Signed-off-by: Sam Ravnborg Signed-off-by: Chris Wright --- diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index 6bc7e7cfccf64..8912c0f5460b5 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c @@ -249,6 +249,8 @@ void parse_config_file(char *map, size_t len) found: if (!memcmp(q - 7, "_MODULE", 7)) q -= 7; + if( (q-p-7) < 0 ) + continue; use_config(p+7, q-p-7); } }