summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rwxr-xr-xtests/complex1.sh4
-rw-r--r--tests/tcpflood.c2
3 files changed, 5 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 3eb185f7..bc3e7750 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -582,6 +582,8 @@ Version 5.10.1 [V5-STABLE], 2012-0?-??
Thanks to pilou@gmx.com for the bug report
- bugfix: remove invalid socket option call from imuxsock
Thanks to Cristian Ionescu-Idbohrn and Jonny Törnbom
+- bugfix: fixed wrong bufferlength for snprintf in tcpflood.c when using
+ the -f (dynafiles) option.
---------------------------------------------------------------------------
Version 5.10.0 [V5-STABLE], 2012-08-23
diff --git a/tests/complex1.sh b/tests/complex1.sh
index e138bff5..56ff15d6 100755
--- a/tests/complex1.sh
+++ b/tests/complex1.sh
@@ -7,8 +7,8 @@ echo ===========================================================================
echo TEST: \[complex1.sh\]: complex test with gzip and multiple action queues
source $srcdir/diag.sh init
# uncomment for debugging support:
-#export RSYSLOG_DEBUG="debug nostdout"
-#export RSYSLOG_DEBUGLOG="log"
+export RSYSLOG_DEBUG="debug nostdout"
+export RSYSLOG_DEBUGLOG="log"
source $srcdir/diag.sh startup complex1.conf
# send 40,000 messages of 400 bytes plus header max, via three dest ports
source $srcdir/diag.sh tcpflood -m40000 -rd400 -P129 -f5 -n3 -c15 -i1
diff --git a/tests/tcpflood.c b/tests/tcpflood.c
index f3a89c77..8fd347f1 100644
--- a/tests/tcpflood.c
+++ b/tests/tcpflood.c
@@ -360,7 +360,7 @@ genMsg(char *buf, size_t maxBuf, int *pLenBuf, struct instdata *inst)
} while(!done); /* Attention: do..while()! */
} else if(MsgToSend == NULL) {
if(dynFileIDs > 0) {
- snprintf(dynFileIDBuf, maxBuf, "%d:", rand() % dynFileIDs);
+ snprintf(dynFileIDBuf, sizeof(dynFileIDBuf), "%d:", rand() % dynFileIDs);
}
if(extraDataLen == 0) {
*pLenBuf = snprintf(buf, maxBuf, "<%s>Mar 1 01:00:00 172.20.245.8 tag msgnum:%s%8.8d:%c",