Skip to content

Commit

Permalink
a fix for missing check-type, which cause a crash(trim operator)
Browse files Browse the repository at this point in the history
Signed-off-by: galsalomon66 <[email protected]>
  • Loading branch information
galsalomon66 committed Nov 8, 2023
1 parent c9a8da2 commit 44ea55b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/s3select_functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -2121,13 +2121,16 @@ struct _fn_leading : public base_function {
base_statement* str = *iter;
v_input = str->eval();
if(v_input.type != value::value_En_t::STRING) {
throw base_s3select_exception("content is not string");
throw base_s3select_exception("content type is not a string");
}
input_string = v_input.str();
if (args_size == 2) {
iter++;
base_statement* next = *iter;
v_remove = next->eval();
if(v_remove.type != value::value_En_t::STRING) {
throw base_s3select_exception("remove type is not a string");
}
}
boost::trim_left_if(input_string,boost::is_any_of(v_remove.str()));
result->set_value(input_string.c_str());
Expand Down

0 comments on commit 44ea55b

Please sign in to comment.