diff options
author | Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> | 2022-05-29 22:39:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-29 22:39:48 +0200 |
commit | a9d7cc4841ea098074b3dc0b42b7b6e73d4d8cd9 (patch) | |
tree | a15ea0890da76b5c723cd3f07e77c74a25cf9efd /src/lib/ndpi_main.c | |
parent | 9c1a53f39f9cadb1961621be689545af1eda67e1 (diff) |
Fix dissection of IPv4 header (#1561)
See: https://github.com/ntop/nDPI/runs/6643914510?check_suite_focus=true
Convert al the `MIN(a,b)` calls to `ndpi_min(a,b)`
Diffstat (limited to 'src/lib/ndpi_main.c')
-rw-r--r-- | src/lib/ndpi_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index 5f5fd593d..52c2b8f85 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -4664,7 +4664,7 @@ static u_int8_t ndpi_detection_get_l4_internal(struct ndpi_detection_module_stru /* 0: fragmented; 1: not fragmented */ if(iph != NULL && ndpi_iph_is_valid_and_not_fragmented(iph, l3_len)) { - u_int16_t len = ntohs(iph->tot_len); + u_int16_t len = ndpi_min(ntohs(iph->tot_len), l3_len); u_int16_t hlen = (iph->ihl * 4); l4ptr = (((const u_int8_t *) iph) + iph->ihl * 4); |