[coreboot-gerrit] Patch set updated for coreboot: util/kconfig: fill glob_t with 0 before calling glob

Stefan Reinauer (stefan.reinauer@coreboot.org) gerrit at coreboot.org
Wed Nov 4 22:12:59 CET 2015


Stefan Reinauer (stefan.reinauer at coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/11711

-gerrit

commit 4c3c49655ae0117df898df864d86ee65dcc5c4f2
Author: zbao <fishbaozi at gmail.com>
Date:   Sat Sep 26 06:49:47 2015 -0400

    util/kconfig: fill glob_t with 0 before calling glob
    
    On mingw, the function glob has some default options
    which are not compliant with man page.
    
    If gl_offs is not set as 0, there may be some slots which
    is reserved.
    If gl_pathc or gl_pathv is not set as 0, the result might
    be appended to the list instead of being added as new ones.
    
    Change-Id: I03110c4cdda70578828d6499262a085a81d26313
    Signed-off-by: Zheng Bao <zheng.bao at amd.com>
    Signed-off-by: Zheng Bao <fishbaozi at gmail.com>
---
 util/kconfig/zconf.l             | 2 +-
 util/kconfig/zconf.lex.c_shipped | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/util/kconfig/zconf.l b/util/kconfig/zconf.l
index b6bed02..0b45c19 100644
--- a/util/kconfig/zconf.l
+++ b/util/kconfig/zconf.l
@@ -339,7 +339,7 @@ void zconf_nextfile(const char *name)
 
 void zconf_nextfiles(const char *wildcard)
 {
-	glob_t g;
+	glob_t g = {0};
 	char **w;
 	int i;
 
diff --git a/util/kconfig/zconf.lex.c_shipped b/util/kconfig/zconf.lex.c_shipped
index cf05b19..99a437b 100644
--- a/util/kconfig/zconf.lex.c_shipped
+++ b/util/kconfig/zconf.lex.c_shipped
@@ -2421,6 +2421,9 @@ void zconf_nextfiles(const char *wildcard)
 	char **w;
 	int i;
 
+	g.gl_pathc = 0;
+	g.gl_pathv = NULL;
+	g.gl_offs = 0;
 	if (glob(wildcard, 0, NULL, &g) != 0) {
 		return;
 	}



More information about the coreboot-gerrit mailing list