iproute2/misc
Andreas Henriksson f26ef6ec09 ss: avoid passing negative numbers to malloc
Example:

$ ss state established \( sport = :4060  or sport = :4061 or sport = :4062  or sport = :4063 or sport = :4064  or sport = :4065 or sport = :4066  or sport = :4067 \)  > /dev/null
Aborted

In the example above ssfilter_bytecompile(...) will return (int)136.
char l1 = 136; means -120 which will result in a negative number
being passed to malloc at misc/ss.c:913.

Simply declare l1 and l2 as integers to avoid the char overflow.

This is one of the issues originally reported in http://bugs.debian.org/511720

Fix the same problem in other code paths as well (thanks to Eric Dumazet).

Reported-by: Andreas Schuldei <andreas@debian.org>
Signed-off-by: Andreas Henriksson <andreas@fatal.se>
Reviewed-by: Eric Dumazet <edumazet@google.com>
2013-11-22 17:03:23 -08:00
..
.gitignore Add ignore files to make using git easier 2006-08-08 12:04:38 -07:00
Makefile iproute2: cleanup dependencies 2012-02-27 08:27:54 -08:00
arpd.c ip: make local functions static 2013-02-12 11:38:35 -08:00
ifstat.c ifstat: add json output format 2013-09-24 11:55:13 -07:00
lnstat.c lnstat: add json output format 2013-09-24 11:55:27 -07:00
lnstat.h add const to find_field 2004-10-19 20:47:13 +00:00
lnstat_util.c Remove trailing whitespace 2006-12-05 10:10:22 -08:00
nstat.c nstat: revise json output 2013-09-24 11:54:45 -07:00
rtacct.c ip: make local functions static 2013-02-12 11:38:35 -08:00
ss.c ss: avoid passing negative numbers to malloc 2013-11-22 17:03:23 -08:00
ssfilter.h (Logical change 1.3) 2004-04-15 20:56:59 +00:00
ssfilter.y Remove trailing whitespace 2006-12-05 10:10:22 -08:00