See patch.

Uwe.
-- 
http://www.hermann-uwe.de  | http://www.holsham-traders.de
http://www.crazy-hacks.org | http://www.unmaintained-free-software.org
When you pass a bogus layout file to the -l option flashrom will segfault.
Fix that by throwing an error instead.

Signed-off-by: Uwe Hermann <[email protected]>

Index: layout.c
===================================================================
--- layout.c	(Revision 3830)
+++ layout.c	(Arbeitskopie)
@@ -156,6 +156,11 @@
 #endif
 		tstr1 = strtok(tempstr, ":");
 		tstr2 = strtok(NULL, ":");
+		if (!tstr1 || !tstr2) {
+			fprintf(stderr, "Error parsing layout file.\n");
+			fclose(romlayout);
+			return 1;
+		}
 		rom_entries[romimages].start = strtol(tstr1, (char **)NULL, 16);
 		rom_entries[romimages].end = strtol(tstr2, (char **)NULL, 16);
 		rom_entries[romimages].included = 0;
--
coreboot mailing list: [email protected]
http://www.coreboot.org/mailman/listinfo/coreboot

Reply via email to