mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 17:48:21 +00:00
Skip input framework entries with missing but non-optional fields
The framework so far populated data structures with missing fields even when those fields are defined without the &optional attribute. When using the attribute, such entries continue to get populated. Update tests to reflect focus on unset fields.
This commit is contained in:
parent
ef08605877
commit
937bdccab5
9 changed files with 122 additions and 59 deletions
|
@ -1935,6 +1935,12 @@ RecordVal* Manager::ValueToRecordVal(const Stream* stream, const Value* const *v
|
|||
// Better check that it really is optional. Uou never know.
|
||||
assert(request_type->FieldDecl(i)->GetAttr(zeek::detail::ATTR_OPTIONAL));
|
||||
}
|
||||
else if ( ! vals[*position]->present &&
|
||||
! request_type->FieldDecl(i)->GetAttr(zeek::detail::ATTR_OPTIONAL) )
|
||||
{
|
||||
Warning(stream, "Skipping input with missing non-optional value");
|
||||
have_error = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
fieldVal = ValueToVal(stream, vals[*position], request_type->GetFieldType(i).get(), have_error);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue