Merge remote-tracking branch 'origin/topic/timw/silly-coverity-fix'

* origin/topic/timw/silly-coverity-fix:
  Check for -1 return from FieldOffset() in Val::HasField()
This commit is contained in:
Tim Wojtulewicz 2021-06-28 11:06:39 -07:00
commit e6e41ac5d9
3 changed files with 8 additions and 2 deletions

View file

@ -1,3 +1,9 @@
4.1.0-dev.814 | 2021-06-28 11:06:39 -0700
* Check for -1 return from FieldOffset() in Val::HasField()
Fixes Coverity 1457804 (Tim Wojtulewicz, Corelight)
4.1.0-dev.812 | 2021-06-28 11:02:46 -0700 4.1.0-dev.812 | 2021-06-28 11:02:46 -0700
* whoops overlooked the need to canonicalize filenames (Vern Paxson, Corelight) * whoops overlooked the need to canonicalize filenames (Vern Paxson, Corelight)

View file

@ -1 +1 @@
4.1.0-dev.812 4.1.0-dev.814

View file

@ -1218,7 +1218,7 @@ public:
bool HasField(const char *field) const bool HasField(const char *field) const
{ {
int idx = GetType()->AsRecordType()->FieldOffset(field); int idx = GetType()->AsRecordType()->FieldOffset(field);
return HasField(idx); return (idx != -1) && HasField(idx);
} }
/** /**