[coreboot-gerrit] Patch set updated for coreboot: 6bc6c3d util/sconfig: fix check for count of command line arguments

Daniele Forsi (dforsi@gmail.com) gerrit at coreboot.org
Sun Jul 27 11:20:24 CEST 2014


Daniele Forsi (dforsi at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/6378

-gerrit

commit 6bc6c3d6f2f94212d8a7551c760336b6a1703474
Author: Daniele Forsi <dforsi at gmail.com>
Date:   Sun Jul 27 11:02:15 2014 +0200

    util/sconfig: fix check for count of command line arguments
    
    Valid invocations are when -s|b|k outputfile is missing (argc == 3)
    and when it is followed by the file name (argc == 5); it's an error
    when "outputfile" is missing (argc == 4) or when there are more
    arguments than expected (argc > 5).
    Fixes "Uninitialized argument value" error found by scan-build from
    clang version 3.2-11.
    
    Change-Id: I8c489863323eb60cbaa5e82a80f5d78a6ca893c2
    Signed-off-by: Daniele Forsi <dforsi at gmail.com>
---
 util/sconfig/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/util/sconfig/main.c b/util/sconfig/main.c
index 74193e6..f6ec0e2 100644
--- a/util/sconfig/main.c
+++ b/util/sconfig/main.c
@@ -557,7 +557,7 @@ static void usage(void)
 
 
 int main(int argc, char** argv) {
-	if (argc < 3)
+	if (argc != 3 && argc != 5)
 		usage();
 
 	char *mainboard=argv[1];



More information about the coreboot-gerrit mailing list