Skip to content

Commit

Permalink
Fix a Use-of-uninitialized-value error
Browse files Browse the repository at this point in the history
```
==1899==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x59a0a2567a0b in dissect_l2 ndpi/src/lib/third_party/src/fuzz/pl7m.c:291:6
    #1 0x59a0a25663ea in dissect_do ndpi/src/lib/third_party/src/fuzz/pl7m.c:711:7
    #2 0x59a0a25663ea in __deserialize_from_fd ndpi/src/lib/third_party/src/fuzz/pl7m.c:1211:8
    #3 0x59a0a2564147 in __deserialize ndpi/src/lib/third_party/src/fuzz/pl7m.c:1241:9
    #4 0x59a0a2564147 in pl7m_mutator ndpi/src/lib/third_party/src/fuzz/pl7m.c:1296:6
```
Found by oss-fuzz (via nDPI)
  • Loading branch information
IvanNardi committed Jul 11, 2024
1 parent 94cb987 commit 2c98926
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pl7m.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ static int dissect_l2(int datalink_type, struct m_pkt *p)
break;

case DLT_PPI:
if (data_len < l2_offset + 4)
if (data_len < l2_offset + 8)
return -1;
header_length = le16toh(*(u_int16_t *)&data[l2_offset + 2]);
dlt = le32toh(*(u_int32_t *)&data[l2_offset + 4]);
Expand Down

0 comments on commit 2c98926

Please sign in to comment.