summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2010-04-19 15:13:33 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2010-04-19 15:13:33 +0200
commitada87cbaefecff9d32f3d008876f2eec59335ded (patch)
treec52339b2e2c2cbfc7a7152bf1cc65912b46932c2 /runtime
parent11ab3c800043b036132b0fc96d20bcba637a72b6 (diff)
parent9039fad4019cb9a0f96eb296835476841b453dd3 (diff)
downloadrsyslog-ada87cbaefecff9d32f3d008876f2eec59335ded.tar.gz
rsyslog-ada87cbaefecff9d32f3d008876f2eec59335ded.tar.xz
rsyslog-ada87cbaefecff9d32f3d008876f2eec59335ded.zip
Merge branch 'v4-devel' into master
Conflicts: ChangeLog Makefile.am configure.ac doc/manual.html runtime/debug.c runtime/rsyslog.h tests/Makefile.am tests/diag.sh tests/nettester.c tools/syslogd.c
Diffstat (limited to 'runtime')
-rw-r--r--runtime/debug.c13
-rw-r--r--runtime/rsyslog.h2
2 files changed, 14 insertions, 1 deletions
diff --git a/runtime/debug.c b/runtime/debug.c
index e7fdf990..899d05da 100644
--- a/runtime/debug.c
+++ b/runtime/debug.c
@@ -157,7 +157,9 @@ static pthread_key_t keyCallStack;
*/
static void dbgMutexCancelCleanupHdlr(void *pmut)
{
- pthread_mutex_unlock((pthread_mutex_t*) pmut);
+ int ret;
+ ret = pthread_mutex_unlock((pthread_mutex_t*) pmut);
+ assert(ret == 0);
}
@@ -963,6 +965,15 @@ dbgoprint(obj_t *pObj, char *fmt, ...)
va_start(ap, fmt);
lenWriteBuf = vsnprintf(pszWriteBuf, sizeof(pszWriteBuf), fmt, ap);
va_end(ap);
+ if(lenWriteBuf >= sizeof(pszWriteBuf)) {
+ /* prevent buffer overrruns and garbagge display */
+ pszWriteBuf[sizeof(pszWriteBuf) - 5] = '.';
+ pszWriteBuf[sizeof(pszWriteBuf) - 4] = '.';
+ pszWriteBuf[sizeof(pszWriteBuf) - 3] = '.';
+ pszWriteBuf[sizeof(pszWriteBuf) - 2] = '\n';
+ pszWriteBuf[sizeof(pszWriteBuf) - 1] = '\0';
+ lenWriteBuf = sizeof(pszWriteBuf);
+ }
dbgprint(pObj, pszWriteBuf, lenWriteBuf);
}
diff --git a/runtime/rsyslog.h b/runtime/rsyslog.h
index 4cb20163..9f29c48d 100644
--- a/runtime/rsyslog.h
+++ b/runtime/rsyslog.h
@@ -394,6 +394,8 @@ enum rsRetVal_ /** return value. All methods return this if not specified oth
RS_RET_VAR_NOT_FOUND = -2142, /**< variable not found */
RS_RET_EMPTY_MSG = -2143, /**< provided (raw) MSG is empty */
RS_RET_PEER_CLOSED_CONN = -2144, /**< remote peer closed connection (information, no error) */
+ RS_RET_ERR_OPEN_KLOG = -2145, /**< error opening the kernel log socket (primarily solaris) */
+ RS_RET_ERR_AQ_CONLOG = -2146, /**< error aquiring console log (on solaris) */
RS_RET_NO_SRCNAME_TPL = -2150, /**< sourcename template was not specified where one was needed (omudpspoof spoof addr) */
RS_RET_HOST_NOT_SPECIFIED = -2151, /**< (target) host was not specified where it was needed */
RS_RET_ERR_LIBNET_INIT = -2152, /**< error initializing libnet */