1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-25 11:41:35 +01:00

Removed access to potentially invalid positions on vector.

This commit is contained in:
Matias Fontanini
2014-11-12 21:11:01 -08:00
parent 0ba05f9d1a
commit 3b126ca02b
2 changed files with 63 additions and 52 deletions

View File

@@ -77,7 +77,7 @@ PDU *IPv4Stream::allocate_pdu() const {
}
return Internals::pdu_from_flag(
static_cast<Constants::IP::e>(transport_proto),
&buffer[0],
buffer.empty() ? 0 : &buffer[0],
buffer.size()
);
}