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 680cfd7 commit bc5c08dCopy full SHA for bc5c08d
Packet++/src/BgpLayer.cpp
@@ -542,6 +542,11 @@ namespace pcpp
542
if (headerLen >= minLen)
543
{
544
size_t withdrawnRouteLen = getWithdrawnRoutesLength();
545
+ // Ensure the memory access is within bounds
546
+ if (sizeof(bgp_common_header) + sizeof(uint16_t) + withdrawnRouteLen + sizeof(uint16_t) > headerLen)
547
+ {
548
+ return 0; // Invalid access, return 0
549
+ }
550
uint16_t res =
551
be16toh(*(uint16_t*)(m_Data + sizeof(bgp_common_header) + sizeof(uint16_t) + withdrawnRouteLen));
552
if ((size_t)res > headerLen - minLen - withdrawnRouteLen)
0 commit comments