From b47d95286bd78282c57fdc200f81d17b187a45dd Mon Sep 17 00:00:00 2001 From: Rainer Gerhards Date: Tue, 12 May 2009 12:03:00 +0200 Subject: bugfix: potential segfault issue when multiple $UDPServerRun directives are specified. Thanks to Michael Biebl for helping to debug this one. --- ChangeLog | 2 ++ plugins/imudp/imudp.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4bf5c000..c8b6cbfa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ Version 3.22.1 [v3-stable] (rgerhards), 2009-04-?? - bugfix: light and full delay watermarks had invalid values, badly affecting performance for delayable inputs +- bugfix: potential segfault issue when multiple $UDPServerRun directives + are specified. Thanks to Michael Biebl for helping to debug this one. --------------------------------------------------------------------------- Version 3.22.0 [v3-stable] (rgerhards), 2009-04-21 This is the first stable release that includes the full functionality diff --git a/plugins/imudp/imudp.c b/plugins/imudp/imudp.c index e9e82b20..79d51263 100644 --- a/plugins/imudp/imudp.c +++ b/plugins/imudp/imudp.c @@ -101,7 +101,7 @@ static rsRetVal addListner(void __attribute__((unused)) *pVal, uchar *pNewVal) udpLstnSocks = newSocks; } else { /* we need to add them */ - if((tmpSocks = malloc(sizeof(int) * 1 + newSocks[0] + udpLstnSocks[0])) == NULL) { + if((tmpSocks = malloc(sizeof(int) * (1 + newSocks[0] + udpLstnSocks[0]))) == NULL) { dbgprintf("out of memory trying to allocate udp listen socket array\n"); /* in this case, we discard the new sockets but continue with what we * already have -- cgit