From 7253bbeed7f6d00bd796019d79dc1fe0a805fa8e Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Wed, 26 May 2010 15:39:19 +0200 Subject: Fixed an issue causing SEGV on some hardware when dmi_processor_id() is called The dmi_processor_id() function did not check the char *version pointer if it was NULL before doing strcmp(). On some hardware, *version will be NULL. --- src/dmidecode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/dmidecode.c') diff --git a/src/dmidecode.c b/src/dmidecode.c index b89c163..4a2e445 100644 --- a/src/dmidecode.c +++ b/src/dmidecode.c @@ -1019,7 +1019,6 @@ xmlNode *dmi_processor_id(xmlNode *node, u8 type, const u8 * p, const char *vers ** CPUID instruction or another form of identification. */ - //. TODO: PyString_FromFormat does not support %x (yet?)... dmixml_AddTextChild(data_n, "ID", "%02x %02x %02x %02x %02x %02x %02x %02x", p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7]); @@ -1075,7 +1074,7 @@ xmlNode *dmi_processor_id(xmlNode *node, u8 type, const u8 * p, const char *vers sig = 2; - } else if(type == 0x01 || type == 0x02) { + } else if(version && (type == 0x01 || type == 0x02)) { /* ** Some X86-class CPU have family "Other" or "Unknown". In this case, ** we use the version string to determine if they are known to -- cgit