mirror_iproute2/misc
willy tarreau 0ee9052f1b 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>
2015-10-12 09:49:06 -07:00
..
.gitignore Add ignore files to make using git easier 2006-08-08 12:04:38 -07:00
arpd.c whitespace cleanup 2014-12-20 15:47:17 -08:00
ifstat.c provide common json output formatter 2015-08-23 10:05:29 -07:00
lnstat_util.c remove unnecessary checks for NULL before free 2015-07-21 10:49:54 -07:00
lnstat.c provide common json output formatter 2015-08-23 10:05:29 -07:00
lnstat.h iproute2: various header include fixes for compiling with musl libc 2014-05-28 16:51:39 -07:00
Makefile configure: Check for Berkeley DB for arpd compilation 2015-09-21 14:38:38 -07:00
nstat.c provide common json output formatter 2015-08-23 10:05:29 -07:00
rtacct.c ip: make local functions static 2013-02-12 11:38:35 -08:00
ss.c fix "ss -p" segfaults 2015-10-12 09:49:06 -07:00
ssfilter.h ss: Allow to specify sport/dport without ':' 2015-03-15 12:11:42 -07:00
ssfilter.y ss: Allow to specify sport/dport without ':' 2015-03-15 12:11:42 -07:00