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:
Johanna Amann 2018-01-18 12:32:56 -08:00
parent db6f028003
commit b0be6c90fe
4 changed files with 90 additions and 0 deletions

View file

@ -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;
}