summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dmidecode.c3
-rw-r--r--dmioem.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/dmidecode.c b/dmidecode.c
index 4c98553..27d5494 100644
--- a/dmidecode.c
+++ b/dmidecode.c
@@ -5243,7 +5243,8 @@ static void dmi_table_decode(u8 *buf, u32 len, u16 num, u16 ver, u32 flags)
/* assign vendor for vendor-specific decodes later */
if (h.type == 1 && h.length >= 6)
- dmi_set_vendor(dmi_string(&h, data[0x04]), dmi_string(&h, data[0x5]));
+ dmi_set_vendor(_dmi_string(&h, data[0x04], 0),
+ _dmi_string(&h, data[0x05], 0));
/* Fixup a common mistake */
if (h.type == 34)
diff --git a/dmioem.c b/dmioem.c
index 217850e..180a95d 100644
--- a/dmioem.c
+++ b/dmioem.c
@@ -68,7 +68,7 @@ void dmi_set_vendor(const char *v, const char *p)
* Often DMI strings have trailing spaces. Ignore these
* when checking for known vendor names.
*/
- len = strlen(v);
+ len = v ? strlen(v) : 0;
while (len && v[len - 1] == ' ')
len--;