diff options
author | Stuart Reilly <rs576h@vyatta.att-mail.com> | 2019-06-28 15:55:00 +0100 |
---|---|---|
committer | Stuart Reilly <rs576h@vyatta.att-mail.com> | 2019-06-28 15:55:00 +0100 |
commit | 4b717276614e20feada22e6fe29ea2099ba9fd37 (patch) | |
tree | fe741901eb5e71728e8095467d1545eb6cb5d8fb /src | |
parent | cc39ef0946fe43fe29f24285649b8fbe18238a57 (diff) |
Fix two potential OOB reads in ndpi_main.c
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/ndpi_main.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index fcc159350..56a9bfa5d 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -5683,8 +5683,8 @@ ndpi_protocol_category_t ndpi_get_proto_category(struct ndpi_detection_module_st char* ndpi_get_proto_name(struct ndpi_detection_module_struct *ndpi_mod, u_int16_t proto_id) { if((proto_id >= ndpi_mod->ndpi_num_supported_protocols) - || ((proto_id < (NDPI_MAX_SUPPORTED_PROTOCOLS+NDPI_MAX_NUM_CUSTOM_PROTOCOLS)) - && (ndpi_mod->proto_defaults[proto_id].protoName == NULL))) + || (proto_id < (NDPI_MAX_SUPPORTED_PROTOCOLS+NDPI_MAX_NUM_CUSTOM_PROTOCOLS)) + || (ndpi_mod->proto_defaults[proto_id].protoName == NULL)) proto_id = NDPI_PROTOCOL_UNKNOWN; return(ndpi_mod->proto_defaults[proto_id].protoName); @@ -5695,8 +5695,8 @@ char* ndpi_get_proto_name(struct ndpi_detection_module_struct *ndpi_mod, u_int16 ndpi_protocol_breed_t ndpi_get_proto_breed(struct ndpi_detection_module_struct *ndpi_mod, u_int16_t proto_id) { if((proto_id >= ndpi_mod->ndpi_num_supported_protocols) - || ((proto_id < (NDPI_MAX_SUPPORTED_PROTOCOLS+NDPI_MAX_NUM_CUSTOM_PROTOCOLS)) - && (ndpi_mod->proto_defaults[proto_id].protoName == NULL))) + || (proto_id < (NDPI_MAX_SUPPORTED_PROTOCOLS+NDPI_MAX_NUM_CUSTOM_PROTOCOLS)) + || (ndpi_mod->proto_defaults[proto_id].protoName == NULL)) proto_id = NDPI_PROTOCOL_UNKNOWN; return(ndpi_mod->proto_defaults[proto_id].protoBreed); |