Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit cff11af

Browse files
committed
dmidecode: Hide irrelevant fixup message
Only display the message about type 34 length fixup if the entry in question is going to be displayed. Otherwise it's only confusing. This fixes bug #109024: http://savannah.nongnu.org/support/?109024 Fixes: 3f70b35 ("dmidecode: Fix up invalid DMI type 34 structure length")
1 parent ab02b11 commit cff11af

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎dmidecode.c‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2949,15 +2949,17 @@ static void dmi_64bit_memory_error_address(u64 code)
29492949
* first 5 characters of the device name to be trimmed. It's easy to
29502950
* check and fix, so do it, but warn.
29512951
*/
2952-
static void dmi_fixup_type_34(struct dmi_header *h)
2952+
static void dmi_fixup_type_34(struct dmi_header *h, intdisplay)
29532953
{
29542954
u8 *p = h->data;
29552955

29562956
/* Make sure the hidden data is ASCII only */
29572957
if (h->length == 0x10
29582958
&& is_printable(p + 0x0B, 0x10 - 0x0B))
29592959
{
2960-
printf("Invalid entry length (%u). Fixed up to %u.\n", 0x10, 0x0B);
2960+
if (!(opt.flags & FLAG_QUIET) && display)
2961+
printf("Invalid entry length (%u). Fixed up to %u.\n",
2962+
0x10, 0x0B);
29612963
h->length = 0x0B;
29622964
}
29632965
}
@@ -4446,7 +4448,7 @@ static void dmi_table_decode(u8 *buf, u32 len, u16 num, u16 ver, u32 flags)
44464448

44474449
/* Fixup a common mistake */
44484450
if (h.type == 34)
4449-
dmi_fixup_type_34(&h);
4451+
dmi_fixup_type_34(&h, display);
44504452

44514453
/* look for the next handle */
44524454
next = data + h.length;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /