From 92ea3b07784853558d93391dbc364c69463cd61d Mon Sep 17 00:00:00 2001 From: David Sommerseth Date: Fri, 10 Apr 2009 11:28:41 +0200 Subject: Fixed wrong string handling of DMI data, which caused SEGV --- src/dmidecode.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/dmidecode.c') 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 -- cgit