File pmcisconames-bugfix-potential-misadressing.patch of Package rsyslog.6132
Index: rsyslog-5.10.1/plugins/pmcisconames/pmcisconames.c
===================================================================
--- rsyslog-5.10.1.orig/plugins/pmcisconames/pmcisconames.c
+++ rsyslog-5.10.1/plugins/pmcisconames/pmcisconames.c
@@ -118,13 +118,18 @@ dbgprintf("msg too short!\n");
--lenMsg;
++p2parse;
}
+ /* Note: we deliberately count the 0-byte below because we need to go chars+1! */
+ if(lenMsg < (int) sizeof(OpeningText)) {
+ dbgprintf("pmcisconames: too short for being cisco messages\n");
+ ABORT_FINALIZE(RS_RET_COULD_NOT_PARSE);
+ }
/* skip the space after the hostname */
lenMsg -=1;
p2parse +=1;
/* if the syslog tag is : and the next thing starts with a % assume that this is a mangled cisco log and fix it */
if(strncasecmp((char*) p2parse, OpeningText, sizeof(OpeningText)-1) != 0) {
/* wrong opening text */
-dbgprintf("not a cisco name mangled log!\n");
+ dbgprintf("not a cisco name mangled log!\n");
ABORT_FINALIZE(RS_RET_COULD_NOT_PARSE);
}
/* bump the message portion up by two characters to overwrite the extra : */