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 file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

pmcisconames bugfix: potential misadressing

  • Loading branch information
rgerhards committed Sep 27, 2019
commit abc0960a7561e18944a0e08d48f4eb570ea7435a
@@ -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 : */
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.