mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 03:58:20 +00:00
Add better length check to BuildOptionsVal()
This commit is contained in:
parent
4c00c3c4ca
commit
95e758e012
3 changed files with 21 additions and 2 deletions
|
@ -20,7 +20,7 @@ static VectorValPtr BuildOptionsVal(const u_char* data, int len)
|
|||
{
|
||||
auto vv = make_intrusive<VectorVal>(id::find_type<VectorType>("ip6_options"));
|
||||
|
||||
while ( len > 0 )
|
||||
while ( static_cast<size_t>(len) >= sizeof(struct ip6_opt) )
|
||||
{
|
||||
static auto ip6_option_type = id::find_type<RecordType>("ip6_option");
|
||||
const struct ip6_opt* opt = (const struct ip6_opt*)data;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue