mirror of
https://github.com/mfontanini/libtins
synced 2026-01-26 20:01:35 +01:00
Fixed a bug in PPI and Dot1Q triggered when constructing from buffer/serializing. Done some documentation fixes.
This commit is contained in:
@@ -47,7 +47,7 @@ PPI::PPI(const uint8_t *buffer, uint32_t total_sz) {
|
||||
if(total_sz < sizeof(_header))
|
||||
throw malformed_packet();
|
||||
std::memcpy(&_header, buffer, sizeof(_header));
|
||||
if(length() > total_sz)
|
||||
if(length() > total_sz || length() < sizeof(_header))
|
||||
throw malformed_packet();
|
||||
buffer += sizeof(_header);
|
||||
total_sz -= sizeof(_header);
|
||||
|
||||
Reference in New Issue
Block a user