forked from osmocom/wireshark
dfilter: Check if type supports unary minus
Fix crash for types that do not support unary minus. Fixes #18750.
This commit is contained in:
parent
c654566fc6
commit
263bda375c
|
@ -1184,6 +1184,10 @@ check_arithmetic_expr(dfwork_t *dfw, stnode_t *st_node, ftenum_t lhs_ftype)
|
|||
|
||||
if (st_op == STNODE_OP_UNARY_MINUS) {
|
||||
ftype1 = check_arithmetic_entity(dfw, st_arg1, lhs_ftype);
|
||||
if (!ftype_can_unary_minus(ftype1)) {
|
||||
FAIL(dfw, st_arg1, "%s cannot %s.",
|
||||
ftype_name(ftype1), stnode_todisplay(st_node));
|
||||
}
|
||||
if (stnode_type_id(st_arg1) == STTYPE_FVALUE) {
|
||||
/* Pre-compute constant unary minus result */
|
||||
char *err_msg;
|
||||
|
|
Loading…
Reference in New Issue