https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=16587

Pascal Quantin <pas...@wireshark.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pas...@wireshark.org
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |CONFIRMED

--- Comment #3 from Pascal Quantin <pas...@wireshark.org> ---
We seem to face a MSVC2019 compiler bug: the crash is systematic when using
RelWithDebInfo but does not happen in Debug mode.
When checking with the debugger, the following code in dfilter-macro.c does not
work as expected:

                                        } case '}': {
                                                gchar* resolved;
                                               
g_ptr_array_add(args,g_string_free(arg,FALSE));
                                                g_ptr_array_add(args,NULL);

                                                arg = NULL;

                                                resolved =
dfilter_macro_resolve(name->str, (gchar**)args->pdata, error);
                                                if (resolved == NULL)
                                                        goto on_error;

                                                changed = TRUE;

                                                g_string_append(out,resolved);
                                                wmem_free(NULL, resolved);

                                                FREE_ALL();

                                                state = OUTSIDE;
                                                break;
                                        }

when leaving the case '}' branch, state variable value is still ARGS instead of
being changed to OUTSIDE. But as args is now NULL, the program will crash when
parsing the string after the filter macro due to a NULL pointer dereference:

                                        } default: {
                                                g_string_append_c(arg,c);
                                                break;

-- 
You are receiving this mail because:
You are watching all bug changes.
___________________________________________________________________________
Sent via:    Wireshark-bugs mailing list <wireshark-bugs@wireshark.org>
Archives:    https://www.wireshark.org/lists/wireshark-bugs
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-bugs
             mailto:wireshark-bugs-requ...@wireshark.org?subject=unsubscribe

Reply via email to