[PATCH ipmi-fru-parser v2] Replace uint8_t buffer length variable with size_t

Daniel Axtens dja at axtens.net
Tue May 17 08:56:06 AEST 2016


Hi,

Looks good to me!

Reviewed-by: Daniel Axtens <dja at axtens.net>

Regards,
Daniel

OpenBMC Patches <openbmc-patches at stwcx.xyz> writes:

> From: Adriana Kobylak <anoo at us.ibm.com>
>
> The latest Barreleye vpd contains additional custom fields in one
> of the board sections, pushing the size of the buffer over 0x100.
>
> The current variable that stores the buffer size is set to be
> size_t, but the function using it crops it to uint8_t  which
> doesn't fit the extended size. Changing the function to use size_t.
>
> Signed-off-by: Adriana Kobylak <anoo at us.ibm.com>
> ---
>  frup.c | 2 +-
>  frup.h | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/frup.c b/frup.c
> index 7bdf35f..49718ba 100644
> --- a/frup.c
> +++ b/frup.c
> @@ -948,7 +948,7 @@ parse_fru (const void* msgbuf, sd_bus_message* vpdtbl)
>    return (rv);
>  }
>  
> -int parse_fru_area (const uint8_t area, const void* msgbuf, const uint8_t len, sd_bus_message* vpdtbl)
> +int parse_fru_area (const uint8_t area, const void* msgbuf, const size_t len, sd_bus_message* vpdtbl)
>  {
>    int ret = 0;
>    int rv = -1;
> diff --git a/frup.h b/frup.h
> index 8400951..64a0562 100644
> --- a/frup.h
> +++ b/frup.h
> @@ -10,7 +10,7 @@ extern "C"
>  
>  /* Parse an IPMI write fru data message into a dictionary containing name value pair of VPD entries.*/
>  int parse_fru (const void* msgbuf, sd_bus_message* vpdtbl);
> -int parse_fru_area (const uint8_t area, const void* msgbuf, const uint8_t len, sd_bus_message* vpdtbl);
> +int parse_fru_area (const uint8_t area, const void* msgbuf, const size_t len, sd_bus_message* vpdtbl);
>  
>  #ifdef __cplusplus
>  }
> -- 
> 2.8.2
>
>
> _______________________________________________
> openbmc mailing list
> openbmc at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/openbmc


More information about the openbmc mailing list