提交 11de39e2 编写于 作者: M Marcin Garski 提交者: Sam Ravnborg

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: NMarcin Garski <mgarski@post.pl>
Signed-off-by: NSam Ravnborg <sam@ravnborg.org>
上级 767e581d
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册