From: Marcin Garski Date: Sat, 5 May 2007 20:49:00 +0000 (+0200) Subject: kconfig: fix mconf segmentation fault X-Git-Tag: v2.6.22-rc1~1007^2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=11de39e2fbbc592018e0a231d0ee773653dcc8d6;p=linux-2.6-omap-h63xx.git kconfig: fix mconf segmentation fault I have found small bug in mconf, when you run it without any argument it will sigsegv. Without patch: $ scripts/kconfig/mconf Segmentation fault With patch: $ scripts/kconfig/mconf can't find file (null) Signed-off-by: Marcin Garski Signed-off-by: Sam Ravnborg --- diff --git a/scripts/kconfig/lex.zconf.c_shipped b/scripts/kconfig/lex.zconf.c_shipped index 800f8c71c40..0fdc9049296 100644 --- a/scripts/kconfig/lex.zconf.c_shipped +++ b/scripts/kconfig/lex.zconf.c_shipped @@ -2264,7 +2264,7 @@ FILE *zconf_fopen(const char *name) FILE *f; f = fopen(name, "r"); - if (!f && name[0] != '/') { + if (!f && name != NULL && name[0] != '/') { env = getenv(SRCTREE); if (env) { sprintf(fullname, "%s/%s", env, name); diff --git a/scripts/kconfig/zconf.l b/scripts/kconfig/zconf.l index cfa46077c6b..187d38ccadd 100644 --- a/scripts/kconfig/zconf.l +++ b/scripts/kconfig/zconf.l @@ -265,7 +265,7 @@ FILE *zconf_fopen(const char *name) FILE *f; f = fopen(name, "r"); - if (!f && name[0] != '/') { + if (!f && name != NULL && name[0] != '/') { env = getenv(SRCTREE); if (env) { sprintf(fullname, "%s/%s", env, name);