[PATCH 02/13] idiag: fix out of bound error parsing idiag messages

Thomas Graf tgraf at suug.ch
Mon Nov 24 09:09:27 PST 2014


On 11/24/14 at 05:14pm, Thomas Haller wrote:
> Signed-off-by: Thomas Haller <thaller at redhat.com>
> ---
>  lib/idiag/idiag_msg_obj.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/idiag/idiag_msg_obj.c b/lib/idiag/idiag_msg_obj.c
> index f1b5e28..b6f55c8 100644
> --- a/lib/idiag/idiag_msg_obj.c
> +++ b/lib/idiag/idiag_msg_obj.c
> @@ -603,7 +603,7 @@ int idiagnl_msg_parse(struct nlmsghdr *nlh, struct idiagnl_msg **result)
>  	if (!msg)
>  		goto errout_nomem;
>  
> -	err = nlmsg_parse(nlh, sizeof(struct inet_diag_msg), tb, IDIAG_ATTR_MAX,
> +	err = nlmsg_parse(nlh, sizeof(struct inet_diag_msg), tb, IDIAG_ATTR_MAX - 1,

Shouldn't this be INET_DIAG_MAX?



More information about the libnl mailing list