aboutsummaryrefslogtreecommitdiff
path: root/src/lib/ndpi_main.c
diff options
context:
space:
mode:
authorIvan Nardi <nardi.ivan@gmail.com>2025-06-11 20:46:09 +0200
committerIvan Nardi <nardi.ivan@gmail.com>2025-06-11 20:46:09 +0200
commit3ddbf0b5f139e7ec0ff3182ddbacca88593e2764 (patch)
tree6d1e0090793186b008fc70e4d16a986b3051fd52 /src/lib/ndpi_main.c
parentaba60ac354e234935f35103dfa83e5090b6e7e2a (diff)
TCP fingerprint: fix an undefined-shift
``` ndpi_main.c:7905:33: runtime error: left shift of 255 by 24 places cannot be represented in type 'int' ``` Found by oss-fuzz. See: https://issues.oss-fuzz.com/issues/423959691
Diffstat (limited to 'src/lib/ndpi_main.c')
-rw-r--r--src/lib/ndpi_main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c
index c98115cfe..3ecff0fb0 100644
--- a/src/lib/ndpi_main.c
+++ b/src/lib/ndpi_main.c
@@ -7902,7 +7902,7 @@ static int ndpi_init_packet(struct ndpi_detection_module_struct *ndpi_str,
else if(opt_len == 3)
val = (options[j] << 16) + (options[j+1] << 8) + options[j+2];
else if(opt_len == 4)
- val = (options[j] << 24) + (options[j+1] << 16) + (options[j+2] << 8) + options[j+3];
+ val = ((u_int32_t)options[j] << 24) + (options[j+1] << 16) + (options[j+2] << 8) + options[j+3];
if(kind == 2)
tcp_mss = val;