Fix a bug in dummyflasher.c special case where no type parameter is given.

Tested.

Signed-off-by: Carl-Daniel Hailfinger <[email protected]>

Index: flashrom-dummyflasher_type_fix/dummyflasher.c
===================================================================
--- flashrom-dummyflasher_type_fix/dummyflasher.c       (Revision 576)
+++ flashrom-dummyflasher_type_fix/dummyflasher.c       (Arbeitskopie)
@@ -35,7 +35,7 @@
        printf_debug("%s\n", __func__);
 
        /* "all" is equivalent to specifying no type. */
-       if (!strcmp(dummytype, "all")) {
+       if (dummytype && (!strcmp(dummytype, "all"))) {
                free(dummytype);
                dummytype = NULL;
        }


-- 
http://www.hailfinger.org/

Index: flashrom-dummyflasher_type_fix/dummyflasher.c
===================================================================
--- flashrom-dummyflasher_type_fix/dummyflasher.c       (Revision 576)
+++ flashrom-dummyflasher_type_fix/dummyflasher.c       (Arbeitskopie)
@@ -35,7 +35,7 @@
        printf_debug("%s\n", __func__);
 
        /* "all" is equivalent to specifying no type. */
-       if (!strcmp(dummytype, "all")) {
+       if (dummytype && (!strcmp(dummytype, "all"))) {
                free(dummytype);
                dummytype = NULL;
        }
-- 
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to