Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pmcisconames bugfix: potential misadressing #3883

Merged
merged 1 commit into from
Oct 1, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion contrib/pmcisconames/pmcisconames.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,19 @@ CODESTARTparse
--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 : */
Expand Down