diff --git a/ChangeLog b/ChangeLog index 7b66cc8..e364699 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2018-04-20 - Fix bug in sorting when guessing flow direction. Issue #92 - Update nfdump.1 man page for xsrcport & xdstport aggregations. Request #109 +- Fix minor bugs 2018-04-01 - Add program exit in nfx.c after panic with correupt data file diff --git a/bin/grammar.y b/bin/grammar.y index 8b7fa24..93f9480 100755 --- a/bin/grammar.y +++ b/bin/grammar.y @@ -1607,7 +1607,7 @@ term: ANY { /* this is an unconditionally true expression, as a filter applies i uint64_t mask; uint32_t offset, shift; char *s = &$2[5]; - if ( s == '\0' ) { + if ( *s == '\0' ) { yyerror("Missing label number"); YYABORT; } @@ -1678,7 +1678,7 @@ term: ANY { /* this is an unconditionally true expression, as a filter applies i uint64_t mask; uint32_t offset, shift; char *s = &$2[3]; - if ( s == '\0' ) { + if ( *s == '\0' ) { yyerror("Missing label number"); YYABORT; } diff --git a/bin/nf_common.c b/bin/nf_common.c index 43749a2..f844fbd 100644 --- a/bin/nf_common.c +++ b/bin/nf_common.c @@ -2389,7 +2389,7 @@ static void String_Flags(master_record_t *r, char *string) { // if record contains unusuall flags, print the flags in hex as 0x.. number if ( r->tcp_flags > 63 ) { - snprintf(string, 7, " 0x%2x\n", r->tcp_flags ); + snprintf(string, 7, " 0x%2x", r->tcp_flags ); } else { string[0] = r->tcp_flags & 32 ? 'U' : '.'; string[1] = r->tcp_flags & 16 ? 'A' : '.'; diff --git a/bin/nfdump.c b/bin/nfdump.c index 8c0e224..e36446e 100644 --- a/bin/nfdump.c +++ b/bin/nfdump.c @@ -1053,6 +1053,11 @@ char Ident[IDENTLEN]; print_format = DefaultMode; } + // limit input chars + if ( strlen(print_format) > 512 ) { + LogError("Length of ouput format string too big - > 512\n"); + exit(255); + } if ( strncasecmp(print_format, "fmt:", 4) == 0 ) { // special user defined output format char *format = &print_format[4];