diff options
author | emanuele-f <black.silver@hotmail.it> | 2019-10-04 11:31:40 +0200 |
---|---|---|
committer | emanuele-f <black.silver@hotmail.it> | 2019-10-04 11:54:05 +0200 |
commit | 76ec74cbf15be6729ee9da28e8be18a6919cbc18 (patch) | |
tree | a9be70ab9f324a030bdc936dfa94efdbb83470be /src/include/ndpi_api.h | |
parent | 8ae5da14727aff7977846dbd5eeae99b65d93d32 (diff) |
Fix out of bounds read in ndpi_match_custom_category
Diffstat (limited to 'src/include/ndpi_api.h')
-rw-r--r-- | src/include/ndpi_api.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/include/ndpi_api.h b/src/include/ndpi_api.h index 194afa7d6..6bf2d5779 100644 --- a/src/include/ndpi_api.h +++ b/src/include/ndpi_api.h @@ -754,12 +754,12 @@ extern "C" { u_int32_t daddr, ndpi_protocol *ret); int ndpi_match_custom_category(struct ndpi_detection_module_struct *ndpi_struct, - char *name, unsigned long *id); + char *name, u_int name_len, unsigned long *id); void ndpi_fill_protocol_category(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow, ndpi_protocol *ret); int ndpi_get_custom_category_match(struct ndpi_detection_module_struct *ndpi_struct, - char *name_or_ip, unsigned long *id); + char *name_or_ip, u_int name_len, unsigned long *id); int ndpi_set_detection_preferences(struct ndpi_detection_module_struct *ndpi_mod, ndpi_detection_preference pref, int value); @@ -782,11 +782,12 @@ extern "C" { * * @par The automata initialized with ndpi_init_automa(); * @par The (sub)string to search + * @par The (sub)string length * @par The id associated with the matched string or 0 id not found. * @return 0 in case of match, or -1 if no match, or -2 if an error occurred. * */ - int ndpi_match_string_id(void *_automa, char *string_to_match, unsigned long *id); + int ndpi_match_string_id(void *_automa, char *string_to_match, u_int match_len, unsigned long *id); /* Utility functions to set ndpi malloc/free/print wrappers */ void set_ndpi_malloc(void* (*__ndpi_malloc)(size_t size)); |