summaryrefslogtreecommitdiffstats
path: root/debug.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-03-27 15:49:09 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-03-27 15:49:09 +0000
commitdbb50ec360556c0d4402808bf326c38831ff1734 (patch)
treebb27ecc97696b1964a1fe73c9f941a45687215a4 /debug.c
parent94e32990ee01bc7622909f40f0839bc4516cd56d (diff)
downloadrsyslog-dbb50ec360556c0d4402808bf326c38831ff1734.tar.gz
rsyslog-dbb50ec360556c0d4402808bf326c38831ff1734.tar.xz
rsyslog-dbb50ec360556c0d4402808bf326c38831ff1734.zip
bugfix: $ModDir did invalid bounds checking, potential overlow in
dbgprintf() - thanks to varmojfekoj for the patch
Diffstat (limited to 'debug.c')
-rw-r--r--debug.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/debug.c b/debug.c
index 39e7fc4f..3b56eede 100644
--- a/debug.c
+++ b/debug.c
@@ -818,7 +818,7 @@ dbgoprint(obj_t *pObj, char *fmt, ...)
lenWriteBuf = vsnprintf(pszWriteBuf, sizeof(pszWriteBuf), fmt, ap);
if(lenWriteBuf >= sizeof(pszWriteBuf)) {
/* if our buffer was too small, we simply truncate. TODO: maybe something better? */
- lenWriteBuf--;
+ lenWriteBuf = sizeof(pszWriteBuf) - 1;
}
va_end(ap);
/*
@@ -892,7 +892,7 @@ dbgprintf(char *fmt, ...)
lenWriteBuf = vsnprintf(pszWriteBuf, sizeof(pszWriteBuf), fmt, ap);
if(lenWriteBuf >= sizeof(pszWriteBuf)) {
/* if our buffer was too small, we simply truncate. TODO: maybe something better? */
- lenWriteBuf--;
+ lenWriteBuf = sizeof(pszWriteBuf) - 1;
}
va_end(ap);
/*