diff options
author | Maksim Salau <maksim.salau@gmail.com> | 2019-07-11 12:03:58 +0300 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2019-07-11 17:44:50 +0000 |
commit | bd4e293b7b6f08efe13e24f766d078954e5c66c9 (patch) | |
tree | 75bd347dc7dac5fed034d83a8fe0dee0c131b06e /wiretap/candump_parser.lemon | |
parent | c9a29e38c7a63498ab97c7305b4f45066a933370 (diff) |
wiretap: candump: Reset error info and fix scanner warnings
candump_open() may be called with non-empty error code and string.
The error code is not reset upon success in run_candump_parser() which may
mislead the caller function thus affecting opening the file.
yy_fatal_error(), yy_alloc(), yy_realloc() and yy_free() make no use
of the yyscanner argument, which results in warnings on OSX.
In order to get rid of those warning we provide our own
implementations of memory allocation functions and hack
YY_EXIT_FAILURE macro in order to pretend using the argument.
Change-Id: I672d374b26970b2699b9d789b6118e97ba660bdf
Reviewed-on: https://code.wireshark.org/review/33892
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'wiretap/candump_parser.lemon')
-rw-r--r-- | wiretap/candump_parser.lemon | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/wiretap/candump_parser.lemon b/wiretap/candump_parser.lemon index 25cb98a78e..2af58a6ea5 100644 --- a/wiretap/candump_parser.lemon +++ b/wiretap/candump_parser.lemon @@ -276,6 +276,9 @@ run_candump_parser(FILE_T fh, int *err, gchar **err_info) if (file_seek(fh, 0, SEEK_SET, err) == -1) return NULL; + *err = 0; + *err_info = NULL; + memset(&state, 0, sizeof(state)); state.fh = fh; |