Skip to content

Commit

Permalink
HPCC-31521 Prevent crash in dafilesrv with an invalid filter
Browse files Browse the repository at this point in the history
Signed-off-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday committed Mar 26, 2024
1 parent 7d2deae commit dbcc64a
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 dbcc64a

Please sign in to comment.