[PATCH 07/10] dmicheck: fix wrong length for reserved fields in type 13

Alex Hung alex.hung at canonical.com
Thu May 21 16:49:49 UTC 2020


On Thu, May 21, 2020 at 1:11 AM Colin Ian King <colin.king at canonical.com>
wrote:

> On 21/05/2020 03:37, Alex Hung wrote:
> > Signed-off-by: Alex Hung <alex.hung at canonical.com>
> > ---
> >  src/dmi/dmicheck/dmicheck.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/src/dmi/dmicheck/dmicheck.c b/src/dmi/dmicheck/dmicheck.c
> > index d163bed3..f23c353b 100644
> > --- a/src/dmi/dmicheck/dmicheck.c
> > +++ b/src/dmi/dmicheck/dmicheck.c
> > @@ -1501,7 +1501,7 @@ static void dmicheck_entry(fwts_framework *fw,
> >                       dmi_reserved_bits_check(fw, table, addr, "Flags",
> hdr, sizeof(uint8_t), 0x5, 1, 7);
> >                       if (hdr->length < 0x15)
> >                               break;
> > -                     for (i = 0x6; i < 0x15; i++)
> > +                     for (i = 0x6; i < 15; i++)
> >                               dmi_reserved_uint8_check(fw, table, addr,
> "Reserved", hdr, i);
> >                       if (hdr->length < 0x16)
> >                               break;
> >
> Is the hdr length check incorrect too?
>

The length is correct.

>
> Also, for (i = 0x6; i < 15; i++)
> maybe should be for (i = 0x6; i < 0xf; i++)
>

The spec says "15 BYTEs", and I think using decimal will be easier to
compare with spec.



-- 
Cheers,
Alex Hung
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/fwts-devel/attachments/20200521/b9a5cd29/attachment.html>


More information about the fwts-devel mailing list