ACK: [PATCH] lib: fwts_ipmi: fix incorrect memset size
Alex Hung
alex.hung at canonical.com
Wed Sep 7 02:16:26 UTC 2016
On 2016-09-06 05:48 PM, 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: Alex Hung <alex.hung at canonical.com>
More information about the fwts-devel
mailing list