summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-10-17 16:51:59 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-10-17 16:51:59 +0200
commitdb21912aa81b416dffc1b2814ccd768dab7cfac1 (patch)
tree8d5e856de2d47197d7ac0a52a08d585ec4f3c1cc
parentbdc609639eae599d2c63bc0ba26a8c70ce718551 (diff)
parent1e4ca690525ec4a547ad0fe3efbcd6d059dda15d (diff)
downloadrsyslog-db21912aa81b416dffc1b2814ccd768dab7cfac1.tar.gz
rsyslog-db21912aa81b416dffc1b2814ccd768dab7cfac1.tar.xz
rsyslog-db21912aa81b416dffc1b2814ccd768dab7cfac1.zip
Merge branch 'v5-stable' into v6-stable
Conflicts: ChangeLog configure.ac doc/manual.html
-rw-r--r--ChangeLog4
-rw-r--r--plugins/imklog/bsd.c6
-rw-r--r--plugins/imklog/solaris_cddl.c2
3 files changed, 7 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 2690568c..fc991a47 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -588,8 +588,8 @@ expected that interfaces, even new ones, break during the initial
syslog plain tcp input plugin (NOT supporting TLS!)
[ported from v4]
---------------------------------------------------------------------------
-Version 5.10.1 [V5-STABLE], 2012-0?-??
-- bugfix: imuxsock truncated head of received message
+Version 5.10.1 [V5-STABLE], 2012-10-17
+- bugfix: imuxsock and imklog truncated head of received message
This happened only under some circumstances. Thanks to Marius
Tomaschwesky, Florian Piekert and Milan Bartos for their help in
solving this issue.
diff --git a/plugins/imklog/bsd.c b/plugins/imklog/bsd.c
index 80ff9494..d4f9f773 100644
--- a/plugins/imklog/bsd.c
+++ b/plugins/imklog/bsd.c
@@ -92,7 +92,9 @@ submitSyslog(int pri, uchar *buf)
/* we now try to parse the timestamp. iff it parses, we assume
* it is a timestamp. Otherwise we know for sure it is no ts ;)
*/
- i = 4; /* first digit after '[' */
+ i = 4; /* space or first digit after '[' */
+ while(buf[i] && isspace(buf[i]))
+ ++i; /* skip space */
secs = 0;
while(buf[i] && isdigit(buf[i])) {
secs = secs * 10 + buf[i] - '0';
@@ -118,7 +120,7 @@ submitSyslog(int pri, uchar *buf)
/* we have a timestamp */
DBGPRINTF("kernel timestamp is %ld %ld\n", secs, nsecs);
bufsize= strlen((char*)buf);
- memcpy(buf+3, buf+i, bufsize - i + 1);
+ memmove(buf+3, buf+i, bufsize - i + 1);
clock_gettime(CLOCK_MONOTONIC, &monotonic);
clock_gettime(CLOCK_REALTIME, &realtime);
diff --git a/plugins/imklog/solaris_cddl.c b/plugins/imklog/solaris_cddl.c
index 7e86c68c..cf5467fc 100644
--- a/plugins/imklog/solaris_cddl.c
+++ b/plugins/imklog/solaris_cddl.c
@@ -216,7 +216,7 @@ sun_getkmsg()
*/
remlen = buflen - len;
- (void) memcpy(buf, &buf[len], remlen);
+ (void) memmove(buf, &buf[len], remlen);
dat.maxlen = MAXLINE - remlen;
dat.buf = &buf[remlen];
} else {