Skip to content

Commit 4191554

Browse files
committed
Fix vuln OSV-2024-957
1 parent f81ced2 commit 4191554

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Packet++/src/PacketUtils.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ namespace pcpp
1717
uint32_t localSum = 0;
1818

1919
// vec len is in bytes
20+
if (vec[i].buffer == nullptr || vec[i].len % 2 != 0) {
21+
PCPP_LOG_ERROR("Invalid buffer or length in computeChecksum");
22+
return 0;
23+
}
2024
for (size_t j = 0; j < vec[i].len / 2; j++)
2125
{
2226
PCPP_LOG_DEBUG("Value to add = 0x" << std::uppercase << std::hex << vec[i].buffer[j]);

0 commit comments

Comments
 (0)