mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 15:18:20 +00:00
Check for -1 return from FieldOffset() in Val::HasField()
Fixes Coverity 1457804
This commit is contained in:
parent
67b45bc502
commit
98a9ae9572
1 changed files with 1 additions and 1 deletions
|
@ -1218,7 +1218,7 @@ public:
|
|||
bool HasField(const char *field) const
|
||||
{
|
||||
int idx = GetType()->AsRecordType()->FieldOffset(field);
|
||||
return HasField(idx);
|
||||
return (idx != -1) && HasField(idx);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue