diff options
author | Andre Lorbach <alorbach@adiscon.com> | 2012-09-28 07:55:48 -0700 |
---|---|---|
committer | Andre Lorbach <alorbach@adiscon.com> | 2012-09-28 07:55:48 -0700 |
commit | 6387d164bb0900cd01b7ff584fa17013bd0eb661 (patch) | |
tree | f608d3d0d14b208c001e7951f8c5affe0f526d65 /tests/tcpflood.c | |
parent | 136f6e097800742ec232c968b2bdd03bfab687f4 (diff) | |
download | rsyslog-6387d164bb0900cd01b7ff584fa17013bd0eb661.tar.gz rsyslog-6387d164bb0900cd01b7ff584fa17013bd0eb661.tar.bz2 rsyslog-6387d164bb0900cd01b7ff584fa17013bd0eb661.zip |
bugfix: fixed wrong bufferlength for snprintf in tcpflood.c
The problem occured when using the -f (dynafiles) option,
and caused some tests to fail.
Diffstat (limited to 'tests/tcpflood.c')
-rw-r--r-- | tests/tcpflood.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/tcpflood.c b/tests/tcpflood.c index f3a89c77..fbd67de9 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, 128, "%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", |