aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/ldap.c
diff options
context:
space:
mode:
authorIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2022-07-12 18:39:05 +0200
committerGitHub <noreply@github.com>2022-07-12 18:39:05 +0200
commit407155755da29734e9b8a8e7a6960c568b1d3188 (patch)
tree9f54b2b2a387f06d6a02207d98c186b5f068b017 /src/lib/protocols/ldap.c
parent9c235796af60977ba316c612d4a02014896127f8 (diff)
ASN1/BER: fix signed integer overflow (#1660)
``` protocols/snmp_proto.c:77:23: runtime error: signed integer overflow: 6 + 2147483647 cannot be represented in type 'int' #0 0x52f69e in ndpi_search_snmp ndpi/src/lib/protocols/snmp_proto.c:77:23 #1 0x4c5347 in check_ndpi_detection_func ndpi/src/lib/ndpi_main.c:5211:4 #2 0x4c5591 in ndpi_check_flow_func ndpi/src/lib/ndpi_main.c:0 #3 0x4c8903 in ndpi_detection_process_packet ndpi/src/lib/ndpi_main.c:6145:15 #4 0x4b3712 in LLVMFuzzerTestOneInput ndpi/fuzz/fuzz_process_packet.c:29:5 [...] ``` Found by oss-fuzzer. See: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=49057
Diffstat (limited to 'src/lib/protocols/ldap.c')
-rw-r--r--src/lib/protocols/ldap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/protocols/ldap.c b/src/lib/protocols/ldap.c
index 70c9c072f..35ea2e199 100644
--- a/src/lib/protocols/ldap.c
+++ b/src/lib/protocols/ldap.c
@@ -38,7 +38,7 @@ static void ndpi_int_ldap_add_connection(struct ndpi_detection_module_struct *nd
void ndpi_search_ldap(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
{
struct ndpi_packet_struct *packet = &ndpi_struct->packet;
- int length;
+ int64_t length;
u_int16_t length_len = 0, msg_id_len;
u_int8_t op;