diff options
author | Luca Deri <deri@ntop.org> | 2019-07-10 19:27:27 +0200 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2019-07-10 19:27:27 +0200 |
commit | da7e595fcf03f4ee61b192804e3d80cda94861f4 (patch) | |
tree | 1f88961aecdc100e62f6cf215d843669b735f31e /src | |
parent | 829a284d486e8987e7afc6d0d548aec3bc78cf59 (diff) |
Fixed uninitialized variable that caused weird errors
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/ndpi_main.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index 9ab71e4b3..4c476cfd6 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -4383,6 +4383,9 @@ void ndpi_fill_protocol_category(struct ndpi_detection_module_struct *ndpi_struc } flow->category = ret->category = ndpi_get_proto_category(ndpi_struct, *ret); + + if(flow->category == 190842) + printf("BUG!!!!\n"); } /* ********************************************************************************* */ @@ -5867,12 +5870,14 @@ int ndpi_match_string_subprotocol(struct ndpi_detection_module_struct *ndpi_stru rc = ac_automata_search(((AC_AUTOMATA_t*)automa->ac_automa), &ac_input_text, &match); ac_automata_reset(((AC_AUTOMATA_t*)automa->ac_automa)); - if(rc) + if(rc) { ret_match->protocol_id = match.number, ret_match->protocol_category = match.category, ret_match->protocol_breed = match.breed; - - return(match.number); + + return(match.number); + } else + return(NDPI_PROTOCOL_UNKNOWN); } #ifdef HAVE_HYPERSCAN @@ -5966,6 +5971,10 @@ static int ndpi_automa_match_string_subprotocol(struct ndpi_detection_module_str NDPI_LOG_DBG2(ndpi_struct, "[NTOP] Unable to find a match for '%s'\n", string_to_match); #endif + ret_match->protocol_id = NDPI_PROTOCOL_UNKNOWN, + ret_match->protocol_category = NDPI_PROTOCOL_CATEGORY_UNSPECIFIED, + ret_match->protocol_breed = NDPI_PROTOCOL_UNRATED; + return(NDPI_PROTOCOL_UNKNOWN); } |