mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 00:58:19 +00:00
Fix segmentation fault when parsing sets containing invalid elements.
Currently the destructor would try to free unallocated memory. This could e.g. be triggered by the input framework reading a set with an invalid element.
This commit is contained in:
parent
db6f028003
commit
b0be6c90fe
4 changed files with 90 additions and 0 deletions
|
@ -400,6 +400,9 @@ threading::Value* Ascii::ParseValue(const string& s, const string& name, TypeTag
|
|||
for ( unsigned int i = 0; i < pos; i++ )
|
||||
delete lvals[i];
|
||||
|
||||
// and set the length of the set to 0, otherwhise the destructor will crash.
|
||||
val->val.vector_val.size = 0;
|
||||
|
||||
goto parse_error;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue