]> git.ipfire.org Git - thirdparty/iproute2.git/commit
fix "ss -p" segfaults
authorwilly tarreau <w@1wt.eu>
Tue, 6 Oct 2015 10:09:33 +0000 (12:09 +0200)
committerStephen Hemminger <shemming@brocade.com>
Mon, 12 Oct 2015 16:49:06 +0000 (09:49 -0700)
commit0ee9052f1bc2f632b7a181aaaee28584fd82cc18
treed734a6232f776bc46c2ac69622b459b3a95997a7
parenta60223bc1c10d4b172caa966acebb5a1620d0d6f
fix "ss -p" segfaults

I've updated Jose's patch to make it slightly simpler (eg: calloc instead
of malloc+memset), and ported it to 4.2.0 which requires it as well, and
attached it to this e-mail.

I can confirm that with this patch 4.1.1 doesn't segfault on me anymore.
The commit message should be reworked I guess though everything's in it
and I didn't want to modify his description.

Can it be merged as-is or should I reword the commit message and reference
Jose as the fix reporter ? We should not let this bug live forever.

From: "j.ps@openmailbox.org" <j.ps@openmailbox.org>

Essentially all that is needed to get rid of this issue is the
addition of:

    memset(u, 0, sizeof(*u));

after:

    if (!(u = malloc(sizeof(*u))))
            break;

Also patched some other situations (strcpy and sprintf uses) that
potentially produce the same results.

Signed-off-by: Jose P Santos <j.ps@openmailbox.org>
[ wt: made Jose's patch slightly simpler, all credits to him for the diag ]
Signed-off-by: Willy Tarreau <w@1wt.eu>
misc/ss.c