From f59ea5f7690c9a01ef6f7f6508084a66c40b1dae Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 26 Apr 2024 19:44:25 +0200 Subject: Merging upstream version 4.2.4. Signed-off-by: Daniel Baumann --- epan/dfilter/dfunctions.c | 10 ++++++---- epan/dfilter/dfvm.c | 4 +++- epan/dfilter/scanner.l | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) (limited to 'epan/dfilter') diff --git a/epan/dfilter/dfunctions.c b/epan/dfilter/dfunctions.c index be36424..4b09b70 100644 --- a/epan/dfilter/dfunctions.c +++ b/epan/dfilter/dfunctions.c @@ -176,10 +176,12 @@ df_func_compare(GSList *stack, uint32_t arg_count, df_cell_t *retval, for (args = stack, i = 0; i < arg_count; args = args->next, i++) { arg1 = args->data; - for (unsigned j = 0; j < arg1->len; j++) { - arg_fvalue = arg1->pdata[j]; - if (fv_ret == NULL || fv_cmp(arg_fvalue, fv_ret)) { - fv_ret = arg_fvalue; + if (arg1 != NULL) { + for (unsigned j = 0; j < arg1->len; j++) { + arg_fvalue = arg1->pdata[j]; + if (fv_ret == NULL || fv_cmp(arg_fvalue, fv_ret)) { + fv_ret = arg_fvalue; + } } } } diff --git a/epan/dfilter/dfvm.c b/epan/dfilter/dfvm.c index cae7336..a0a21b6 100644 --- a/epan/dfilter/dfvm.c +++ b/epan/dfilter/dfvm.c @@ -1428,7 +1428,9 @@ stack_pop(dfilter_t *df, dfvm_value_t *arg1) for (unsigned i = 0; i < count; i++) { /* Free top of stack data. */ - g_ptr_array_unref(df->function_stack->data); + if (df->function_stack->data) { + g_ptr_array_unref(df->function_stack->data); + } /* Remove top of stack. */ df->function_stack = g_slist_delete_link(df->function_stack, df->function_stack); } diff --git a/epan/dfilter/scanner.l b/epan/dfilter/scanner.l index e5565d2..c6b876a 100644 --- a/epan/dfilter/scanner.l +++ b/epan/dfilter/scanner.l @@ -902,8 +902,8 @@ parse_charconst(dfsyntax_t *dfs, const char *s, unsigned long *valuep) dfilter_fail(dfs, DF_ERROR_GENERIC, dfs->string_loc, "%s isn't a valid character constant.", s); return false; } + cp++; } - cp++; break; case 'u': -- cgit v1.2.3