1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-26 20:01:35 +01:00

Fixed bugs in IPv6 and ICMPv6 when constructing an object from a buffer.

This commit is contained in:
Matias Fontanini
2012-12-01 13:43:19 -03:00
parent 9bdee61e5b
commit dd9c0b3fd5
2 changed files with 3 additions and 3 deletions

View File

@@ -40,7 +40,7 @@ IPv6::IPv6(const uint8_t *buffer, uint32_t total_sz)
throw header_size_error();
// every ext header is at least 8 bytes long
// minus one, from the next_header field.
uint8_t size = buffer[1] + 8;
uint32_t size = static_cast<uint32_t>(buffer[1]) + 8;
// -1 -> next header identifier
if(total_sz < size)
throw header_size_error();