Skip to content

Commit

Permalink
Merge pull request #18451 from ghalliday/issue31521
Browse files Browse the repository at this point in the history
HPCC-31521 Prevent crash in dafilesrv with an invalid filter

Reviewed-by: Jake Smith <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored Mar 28, 2024
2 parents 48503cf + dbcc64a commit 15b45da
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions rtl/eclrtl/rtlnewkey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2159,12 +2159,14 @@ void RowFilter::addFilter(const IFieldFilter & filter)

const IFieldFilter & RowFilter::addFilter(const RtlRecord & record, const char * filterText)
{
IFieldFilter & filter = *deserializeFieldFilter(record, filterText);
filters.append(filter);
unsigned fieldNum = filter.queryFieldIndex();
IFieldFilter * filter = deserializeFieldFilter(record, filterText);
if (!filter)
throw makeStringExceptionV(0, "Could not process filter %s", filterText);
filters.append(*filter);
unsigned fieldNum = filter->queryFieldIndex();
if (fieldNum >= numFieldsRequired)
numFieldsRequired = fieldNum+1;
return filter;
return *filter;
}

bool RowFilter::matches(const RtlRow & row) const
Expand Down

0 comments on commit 15b45da

Please sign in to comment.