ACK: [PATCH] lib: fwts_ipmi: fix incorrect memset size

ivanhu ivan.hu at canonical.com
Wed Sep 7 01:56:30 UTC 2016



On 2016年09月06日 17:48, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> The memset size should be the size of the recv_data array rather
> than sizeof(IPMI_MAX_MSG_LENGTH). Fix this.
>
> Found using static anaylsis with smatch.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
>  src/lib/src/fwts_ipmi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/lib/src/fwts_ipmi.c b/src/lib/src/fwts_ipmi.c
> index 1e18dad..3839c9d 100644
> --- a/src/lib/src/fwts_ipmi.c
> +++ b/src/lib/src/fwts_ipmi.c
> @@ -63,7 +63,7 @@ int fwts_ipmi_exec_query(
>  		return FWTS_ERROR;
>  	}
>
> -	memset(&recv_data, 0, sizeof(IPMI_MAX_MSG_LENGTH));
> +	memset(&recv_data, 0, sizeof(recv_data));
>  	fwts_ipmi_recv.msg.data = recv_data;
>  	fwts_ipmi_recv.msg.data_len = sizeof (recv_data);
>  	fwts_ipmi_recv.addr = (unsigned char *)&fwts_ipmi_addr;
>

Acked-by: Ivan Hu <ivan.hu at canonical.com>



More information about the fwts-devel mailing list