mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 02:28:21 +00:00
fix one of the bugs seth found in the input framework.
(bug in PutTable when the table contained only one element and that element should not be wrapped into a record)
This commit is contained in:
parent
7e5f733826
commit
93fac7a4be
5 changed files with 388 additions and 7 deletions
|
@ -1083,12 +1083,11 @@ int Manager::PutTable(const ReaderFrontend* reader, int id, const Value* const *
|
|||
Val* idxval = ValueToIndexVal(filter->num_idx_fields, filter->itype, vals);
|
||||
Val* valval;
|
||||
|
||||
|
||||
int position = filter->num_idx_fields;
|
||||
if ( filter->num_val_fields == 0 ) {
|
||||
valval = 0;
|
||||
} else if ( filter->num_val_fields == 1 && !filter->want_record ) {
|
||||
valval = ValueToVal(vals[filter->num_idx_fields], filter->rtype->FieldType(filter->num_idx_fields));
|
||||
} else if ( filter->num_val_fields == 1 && filter->want_record == 0 ) {
|
||||
valval = ValueToVal(vals[position], filter->rtype->FieldType(0));
|
||||
} else {
|
||||
valval = ValueToRecordVal(vals, filter->rtype, &position);
|
||||
}
|
||||
|
@ -1130,6 +1129,7 @@ int Manager::PutTable(const ReaderFrontend* reader, int id, const Value* const *
|
|||
if ( filter->num_val_fields > 0 )
|
||||
vl.append(valval);
|
||||
|
||||
|
||||
Val* v = filter->pred->Call(&vl);
|
||||
bool result = v->AsBool();
|
||||
Unref(v);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue