Skip to content

Commit

Permalink
kconfig: fix mconf segmentation fault
Browse files Browse the repository at this point in the history
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 <mgarski@post.pl>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
  • Loading branch information
Marcin Garski authored and sravnborg committed May 6, 2007
1 parent 767e581 commit 11de39e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scripts/kconfig/lex.zconf.c_shipped
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion scripts/kconfig/zconf.l
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 11de39e

Please sign in to comment.