summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Sommerseth <davids@redhat.com>2010-05-26 15:39:19 +0200
committerDavid Sommerseth <davids@redhat.com>2010-05-26 15:39:19 +0200
commit7253bbeed7f6d00bd796019d79dc1fe0a805fa8e (patch)
tree682ac3aa5e5136b86a9e275dd4dc3dda7142ce10 /src
parent1e9d9abffa27a45d24cb2e978f302ff25c2c7f76 (diff)
downloadpython-dmidecode-7253bbeed7f6d00bd796019d79dc1fe0a805fa8e.tar.gz
python-dmidecode-7253bbeed7f6d00bd796019d79dc1fe0a805fa8e.tar.xz
python-dmidecode-7253bbeed7f6d00bd796019d79dc1fe0a805fa8e.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/dmidecode.c3
1 files changed, 1 insertions, 2 deletions
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