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. --- plugins/imudp/imudp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/imudp/imudp.c') 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 v1.2.3