kbuild: scripts/basic/fixdep segfault on pathological string-o-death
[powerpc.git] / scripts / basic / fixdep.c
index 6bc7e7c..8912c0f 100644 (file)
@@ -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);
        }
 }