diff options
author | David Sommerseth <davids@redhat.com> | 2009-04-10 11:28:41 +0200 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2009-04-29 11:22:11 +0200 |
commit | 92ea3b07784853558d93391dbc364c69463cd61d (patch) | |
tree | 341570d96e835ca904d3f1d4f471d02c4397a439 /src/dmidecode.c | |
parent | 46988f9abcec9eb072be5f5d52fc594de89478e8 (diff) | |
download | python-dmidecode-92ea3b07784853558d93391dbc364c69463cd61d.tar.gz python-dmidecode-92ea3b07784853558d93391dbc364c69463cd61d.tar.xz python-dmidecode-92ea3b07784853558d93391dbc364c69463cd61d.zip |
Fixed wrong string handling of DMI data, which caused SEGV
Diffstat (limited to 'src/dmidecode.c')
-rw-r--r-- | src/dmidecode.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dmidecode.c b/src/dmidecode.c index f6f4283..9c00e63 100644 --- a/src/dmidecode.c +++ b/src/dmidecode.c @@ -3656,7 +3656,7 @@ void dmi_decode(xmlNode *handle_n, struct dmi_header * h, u16 ver) dmi_codes_major *dmiMajor = (dmi_codes_major *) &dmiCodesMajor[h->type]; dmixml_AddAttribute(handle_n, "id", "%s", dmiMajor->id); - dmixml_AddAttribute(handle_n, "type", "%s", h->type); + dmixml_AddAttribute(handle_n, "type", "%i", h->type); dmixml_AddTextChild(handle_n, "description", "%s", dmiMajor->desc); switch (h->type) { @@ -3670,9 +3670,9 @@ void dmi_decode(xmlNode *handle_n, struct dmi_header * h, u16 ver) break; } - dmixml_AddTextChild(sect_n, "Vendor", "%s", data[0x04]); - dmixml_AddTextChild(sect_n, "Version", "%s", data[0x05]); - dmixml_AddTextChild(sect_n, "ReleaseDate", "%s", data[0x08]); + dmixml_AddTextChild(sect_n, "Vendor", "%s", dmi_string(h, data[0x04])); + dmixml_AddTextChild(sect_n, "Version", "%s", dmi_string(h, data[0x05])); + dmixml_AddTextChild(sect_n, "ReleaseDate", "%s", dmi_string(h, data[0x08])); /* * On IA-64, the BIOS base address will read 0 because |