[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [dmidecode] [PATCH] dmidecode: use DWORD for Structure table maximum
From: |
Jean Delvare |
Subject: |
Re: [dmidecode] [PATCH] dmidecode: use DWORD for Structure table maximum size in SMBIOS3 |
Date: |
Mon, 01 Feb 2016 09:32:12 +0100 |
Le Saturday 30 January 2016 à 15:22 +0800, Xie XiuQi a écrit :
> http://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.0.0d.pdf
>
> 0Ch DWORD "Structure table maximum size"
>
> Maximum size of SMBIOS Structure Table, pointed to by
> the Structure Table Address, in bytes. The actual size is
> guaranteed to be less or equal to the maximum size
>
> Signed-off-by: Xie XiuQi <address@hidden>
> ---
> dmidecode.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/dmidecode.c b/dmidecode.c
> index f41c85b..b7b03dd 100644
> --- a/dmidecode.c
> +++ b/dmidecode.c
> @@ -4599,7 +4599,7 @@ static int smbios3_decode(u8 *buf, const char *devmem,
> u32 flags)
> }
>
> dmi_table(((off_t)offset.h << 32) | offset.l,
> - WORD(buf + 0x0C), 0, ver, devmem, flags | FLAG_STOP_AT_EOT);
> + DWORD(buf + 0x0C), 0, ver, devmem, flags | FLAG_STOP_AT_EOT);
>
> if (opt.flags & FLAG_DUMP_BIN)
> {
Good catch! Applied, thanks.
Out of curiosity, did you find this bug by code analysis or do you
actually have a system where the maximum table size doesn't fit on 32
bits?
--
Jean Delvare
SUSE L3 Support
- Re: [dmidecode] [PATCH] dmidecode: use DWORD for Structure table maximum size in SMBIOS3,
Jean Delvare <=