From 90c922f2ca1fd6541b9cf32f392c64f9532b647b Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Sun, 12 Apr 2015 12:25:55 -0500 Subject: [PATCH] monitor: Fix buffer overrun When printing New Address events, the extra_str buffer is overrun, resulting in weird stuff happening. > RTNL: Error (0x02) len 20 > 5.252075 Flags: 0 (0x000) Sequence number: 189 (0x000000bd) Port ID: 2116 ACK: 0 ==4080== Invalid read of size 1 ==4080== at 0x4E8000E: vfprintf (in /lib64/libc-2.20.so) ==4080== by 0x4EA8A24: vsnprintf (in /lib64/libc-2.20.so) ==4080== by 0x4E86011: snprintf (in /lib64/libc-2.20.so) ==4080== by 0x403B64: print_packet (nlmon.c:238) ==4080== by 0x40C8FD: print_nlmsghdr (nlmon.c:3197) ==4080== by 0x40CD9E: print_rtnl_msg (nlmon.c:3266) ==4080== by 0x40CE4F: nlmon_print_rtnl (nlmon.c:3298) ==4080== by 0x40D1CD: nlmon_receive (nlmon.c:3390) --- monitor/nlmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monitor/nlmon.c b/monitor/nlmon.c index 8c5aa174..dfd626f7 100644 --- a/monitor/nlmon.c +++ b/monitor/nlmon.c @@ -3179,7 +3179,7 @@ static const char *nlmsg_type_to_str(uint32_t msg_type) static void print_nlmsghdr(const struct timeval *tv, const struct nlmsghdr *nlmsg) { - char extra_str[32]; + char extra_str[256]; const char *str; bool out;