We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f81ced2 commit 4191554Copy full SHA for 4191554
Packet++/src/PacketUtils.cpp
@@ -17,6 +17,10 @@ namespace pcpp
17
uint32_t localSum = 0;
18
19
// 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
+ }
24
for (size_t j = 0; j < vec[i].len / 2; j++)
25
{
26
PCPP_LOG_DEBUG("Value to add = 0x" << std::uppercase << std::hex << vec[i].buffer[j]);
0 commit comments