Skip to content

Commit 9ddb75c

Browse files
m-filippilian-bo
authored andcommitted
Fix memory Type Detail map size
Bit mapped type descriptions array size must be kept coerent with bit mask, for index and array size in xml map otherwise nasty errors could arise. Problem discovered on a machine having <TypeDetails dmispec="7.18.3" flags="0x2080">
1 parent 8c3371f commit 9ddb75c

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/dmidecode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2905,9 +2905,9 @@ void dmi_memory_device_type_detail(xmlNode *node, u16 code)
29052905
dmixml_AddAttribute(data_n, "dmispec", "7.18.3");
29062906
dmixml_AddAttribute(data_n, "flags", "0x%04x", code);
29072907

2908-
if((code & 0x1FFE) != 0) {
2908+
if((code & 0xFFFE) != 0) {
29092909
int i;
2910-
for(i = 1; i <= 14; i++) {
2910+
for(i = 1; i <= 15; i++) {
29112911
if(code & (1 << i)) {
29122912
xmlNode *td_n = dmixml_AddTextChild(data_n, "flag", "%s", detail[i - 1]);
29132913
assert( td_n != NULL );

src/pymap.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@
440440
valuetype="string" value="concat(TotalWidth, ' ', TotalWidth/@unit)"/>
441441
<Map keytype="constant" key="AssetTag" valuetype="string" value="AssetTag"/>
442442
<Map keytype="constant" key="Type Detail" valuetype="list:string" value="TypeDetails/flag"
443-
fixedsize="12" index_attr="index"/>
443+
fixedsize="15" index_attr="index"/>
444444
<Map keytype="constant" key="Array Handle" valuetype="string" value="@ArrayHandle"/>
445445
<Map keytype="constant" key="Form Factor" valuetype="string" value="FormFactor"/>
446446
<Map keytype="constant" key="Size"

0 commit comments

Comments
 (0)