aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dfilter
AgeCommit message (Collapse)AuthorFilesLines
2019-02-18Include epan header files in VS solution.Michael Mann1-1/+24
Add header files lists to add_library() so that Visual Studio can pick them up and include them in a "Header Files" folder for easier navigation within Visual Studio. Change-Id: I7cd8e39550f4db67eed8205593060ae8b4a5b1b9 Reviewed-on: https://code.wireshark.org/review/31289 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2019-02-02CMake: Fix DOCDIR on UnixJoão Valverde1-1/+1
User guides are installed to doc/Wireshark. Use doc/wireshark instead. Remove leftover variable CPACK_PACKAGE_NAME. Change-Id: I9a1d6bdc7d8f0b48c61e43679285d5ba83904a63 Reviewed-on: https://code.wireshark.org/review/31851 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
2019-01-28Further improve that error message.Guy Harris1-1/+1
Put the function name in quotes. Change-Id: I09be392a9bac3b56c13b82a554d17ea29695657c Reviewed-on: https://code.wireshark.org/review/31790 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-01-28Fix an error message.Guy Harris1-1/+2
I guess "s" in "The function s" was supposed to be "%s", giving the function name. Make it so, and properly fetch the function name. Change-Id: I67287f24626fa0a2816fb2cf574e5d9ff58713bf Reviewed-on: https://code.wireshark.org/review/31787 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-01-28dfilter: fix memory leaks on dfilter compile errors involving a setPeter Wu2-5/+13
If a display filter contains a set for the set membership operator and an error occurs, then gen_relation_in() (called via dfw_gencode() will not take ownership of the set and a memory leak occurs. Fix this by implementing a free callback for STTYPE_SET nodes which frees unclaimed data. Add tests to verify the effectiveness, ASAN no longer complains after this fix. Bug: 15442 Change-Id: If37cf047660464b2d0304748034d0bc22111e5d6 Reviewed-on: https://code.wireshark.org/review/31758 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-28dfilter: fix memory leaks if a dfilter fails to compilePeter Wu4-2/+27
A display filter can contain values such as strings, numbers, etc. These are internally stored in a fvalue_t structure. While compiling a display filter, it will store a fvalue_t in a node of type STTYPE_FVALUE. These nodes are created while parsing the dfilter in dfilter_compile(). If the semantic check and conversion (dfw_semcheck()) succeeds, it will transfer the values of the parsed tree to dfw_gencode(). After that, dfwork_free will dispose the tree while a compiled dfilter code remains. When the dfilter code is destroyed, it will free the values too. However, when dfw_semcheck() fails (for example, due to an illegal filter such as "len(badname)==1"), it will skip "dfw_gencode()" and consequently the fvalue data is not transferred nor freed. Fix this by always freeing the data (unless the data was stolen by dfw_gencode()). Fixes a memory leak reported for case_dfunction_string::test_fail_2 which was detected by ASAN. Bug: 15442 Change-Id: I9b1cb613659890c8ddcfa57f11f9d3f61a51a3f9 Reviewed-on: https://code.wireshark.org/review/31757 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-14dfilter: add string() function.Dario Lombardo1-4/+135
This function can convert non-string fields into strings. This allows the user to apply string functions (like contains and matches) to non-string fields. Examples: string(frame.number) matches "[13579]$" => for odd frames string(eth.dst) matches "aa\.bb\.cc\.dd\.ee\..." => to match a group of stations string(snmp.name) matches "^1.2.3.4" => for all OIDs under a specific node Change-Id: I18173f50ba5314ecdcd1e4b66c7e8ba5b44257ee Reviewed-on: https://code.wireshark.org/review/31427 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-10dfilter: remove size() function.Dario Lombardo1-58/+3
It is overlapping to len(), then they've been merged into len() that now gives the length of any field. Change-Id: I8e39536a4d15eff4c4b44bb39fd965729cc46951 Reviewed-on: https://code.wireshark.org/review/31462 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Dario Lombardo <lomato@gmail.com>
2019-01-07dfilter: remove legacy comment.Dario Lombardo1-1/+0
Change-Id: Iec4ea07e86907e9c52b2b58a3e7d8f4a75e747ef Reviewed-on: https://code.wireshark.org/review/31426 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-19Always set *dfp to NULL on an error return from dfilter_compile().Guy Harris1-0/+1
All other error-return code paths set *dfp to NULL; make this one do so as well. Change-Id: I4015c1d53bdbac99cdeda158d7d01c8da7bf2562 Reviewed-on: https://code.wireshark.org/review/31102 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-11-24Install development headers on all platformsJoão Valverde1-5/+3
Install headers to support plugins development on Windows. Change-Id: I3161bd2f730edf62ab44fee6ce4fedbb9aee0d31 Reviewed-on: https://code.wireshark.org/review/30776 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
2018-09-10Avoid using -Werror with generated code.João Valverde1-2/+3
Change-Id: I5812eeedd1c6f53b62417a53f3613c2af476634c Reviewed-on: https://code.wireshark.org/review/29510 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde <j@v6e.pt>
2018-09-10Remove the probes.Guy Harris1-28/+0
(It's llvm-gcc, and appears to be a version too old to support _Pragma("gcc diagnostic ...").) Change-Id: I220997890636d5a5c33889d2e6c640feee155deb Reviewed-on: https://code.wireshark.org/review/29580 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-09-10Maybe we have to treat llvm-gcc specially.Guy Harris1-2/+2
Change-Id: I73aa608a31a79fa58cb5a86aceaaa778adf0aa2c Reviewed-on: https://code.wireshark.org/review/29579 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-09-10Test with (llvm-)GCC pragmas, as the buildbot builds with llvm-gcc.Guy Harris1-1/+12
Change-Id: Ic1dd2e4d17cabb1cd62f8b1ad211dc6915835359 Reviewed-on: https://code.wireshark.org/review/29578 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-09-10Test what kind of compiler we have running on the macOS buildbot.Guy Harris1-6/+14
Change-Id: Ib1a14256ce0fbcfa357368e8431705606a8412e0 Reviewed-on: https://code.wireshark.org/review/29574 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-09-10Try directly using _Pragma if building on/for macOS.Guy Harris1-0/+9
Change-Id: Ib7a48c06a1244b26a9f9a8b733ca4769385603e8 Reviewed-on: https://code.wireshark.org/review/29573 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-08-31Add support for protocol aliases. Switch BOOTP to DHCP.Gerald Combs1-11/+16
Add support for aliasing one protocol name to another and for filtering using aliased fields. Mark aliased fields as deprecated. Rename the BOOTP dissector to DHCP and alias "bootp" to "dhcp". This lets you use both "dhcp.type" and "bootp.type" as display filter fields without having to duplicate all 500+ DHCP/BOOTP fields. To do: - Add checks to proto.c:check_valid_filter_name_or_fail? - Transition SSL to TLS. - Rename packet-bootp.c to packet-dhcp.c? Change-Id: I29977859995e8347d80b8e83f1618db441b10279 Ping-Bug: 14922 Reviewed-on: https://code.wireshark.org/review/29327 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-06-18Better name for the routine.Guy Harris1-3/+3
It doesn't necessarily produce an FT_BYTES value any more. Change-Id: I7bad1e328394a829400bd139c48a9538c4892818 Reviewed-on: https://code.wireshark.org/review/28318 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-06-17For the contains operator, both sides have to have the same type.Guy Harris1-6/+7
Have charconst_to_bytes() take the desired type as an argument, and pass it to dfilter_fvalue_from_unparsed(). Bug: 14084 Change-Id: I11db417311b9681b18c4a3fca2862b35837194d7 Reviewed-on: https://code.wireshark.org/review/28315 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-14Free g_array_free-related memory leaksPeter Wu1-3/+1
g_array_free(a, FALSE) returns "a->data". Callers that do not handle this will leak memory. Convert other users to use the return value instead of direct access to "a->data". Change-Id: I0a29864e8106c0bf09e9573ef29e4474179c4171 Reviewed-on: https://code.wireshark.org/review/27438 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-05-14Free g_ptr_array_free-related memory leaksPeter Wu1-2/+1
g_ptr_array_free(a, FALSE) returns "a->pdata". Callers that do not handle this will leak memory (e.g. "tshark -G plugins"). Convert other users to use the return value instead of direct access to "a->pdata". Change-Id: I29835477d587f5f54bf0d94cdae9f375e3da3ce3 Reviewed-on: https://code.wireshark.org/review/27437 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-04-25dfilter: fix memleaks with functions and slice operatorPeter Wu3-7/+28
Running tools/dfilter-test.py with LSan enabled resulted in 38 test failures due to memory leaks from "fvalue_new". Problematic dfilters: - Return values from functions, e.g. `len(data.data) > 8` (instruction CALL_FUNCTION invoking functions from epan/dfilter/dfunctions.c) - Slice operator: `data.data[1:2] == aa:bb` (function mk_range) These values end up in "registers", but as some values (from READ_TREE) reference the proto tree, a new tracking flag ("owns_memory") is added. Add missing tests for some functions and try to improve documentation. Change-Id: I28e8cf872675d0a81ea7aa5fac7398257de3f47b Reviewed-on: https://code.wireshark.org/review/27132 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-25dfilter: fix small leak for filters containing rangesPeter Wu1-7/+1
A filter such as "data.data[1] == 2" would leak the GSList structure. Change-Id: If57ffbdbf815434f6e11fb53ffa031dde370a9ec Reviewed-on: https://code.wireshark.org/review/27131 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-18dfilter: require spaces as set element separatorPeter Wu4-6/+23
Previously a filter such as `http.request.method in {"GET"HEAD""}` would be parsed as three strings (GET, HEAD and an empty string). As it seems more likely that people make typos rather than intending to construct such a filter, forbid this by always requiring a whitespace separator. Change-Id: I77e531fd6be072f62dd06aac27f856106c8920c6 Reported-by: Stig Bjørlykke Reviewed-on: https://code.wireshark.org/review/26989 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-18dfilter: make spaces around ".." optional in display filterPeter Wu1-2/+9
For numeric values such as port numbers, "4430..4434" looks more natural than "4430 .. 4434", so support that. To make this possible, the display filter syntax needs to be restricted. Assume that neither field names nor values can contain "..". The display filter `data contains ..` will now be considered a syntax error and must be written as `data contains ".."` instead. More generally, all values that contain ".." must be quoted. Other than the ".." restriction, the scanner deliberately accepts more characters that can potentially form invalid input. This is to prevent accidentally splitting input in multiple tokens. For example, "9.2." in "frame.time_delta in {9.2.}" is currently parsed as one token and then rejected because it cannot be parsed as time. If the scanner was made stricter, it could treat it as two tokens (floats), "9." and "2." which has different meaning for the set membership operator. An unhandled edge case is "1....2" which is parsed as "1 .. .. 2" but could have been parsed as "1. .. .2" instead. A float with trailing dots followed by ".." seems sufficiently weird, so rejection is fine. Ping-Bug: 14180 Change-Id: Ibad8e851b49346c9d470f09d5d6a54defa21bcb9 Reviewed-on: https://code.wireshark.org/review/26960 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-18dfilter: add range support to set membership operator ("f in {x .. y}")Peter Wu8-32/+162
Allow "tcp.srcport in {1662 1663 1664}" to be abbreviated to "tcp.srcport in {1662 .. 1664}". The range operator is supported for any field value which supports the "<=" and "=>" operators and thus works for integers, IP addresses, etc. The naive mapping "tcp.srcport >= 1662 and tcp.srcport <= 1664" is not used because it does not have the intended effect with fields that have multiple occurrences (e.g. tcp.port). Each condition could be satisfied by an other value. Therefore a new DVFM instruction (ANY_IN_RANGE) is added to test the range condition against each individual field value. Bug: 14180 Change-Id: I53c2d0f9bc9d4f0ffaabde9a83442122965c95f7 Reviewed-on: https://code.wireshark.org/review/26945 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-18Remove autotools build system.Dario Lombardo1-137/+0
It has been replaced by cmake. Change-Id: I83a5eddb8645dbbf6bca9f026066d2e995d8e87a Reviewed-on: https://code.wireshark.org/review/26969 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-04-17glib: Use g_slist_free_full() in a couple of places.Anders2-6/+4
Change-Id: Iff833bf5c197959c8decb62d6ce794c6d0415fb7 Reviewed-on: https://code.wireshark.org/review/26978 Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-07spdx: more licenses converted.Dario Lombardo2-26/+2
Change-Id: I3861061ec261e63b23621799e020e811ed78a343 Reviewed-on: https://code.wireshark.org/review/26333 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-21dfilter: use g_malloc0 to prevent uninitialized memory to be used.Dario Lombardo1-2/+1
Found by clang. Change-Id: I89497bd0f32c79f82218c6d254a214364c930eb3 Reviewed-on: https://code.wireshark.org/review/25884 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-17Don't make separate libXXX_generated libraries.Guy Harris1-20/+4
We no longer use different compiler flags for generated and non-generated files, so we don't need to put them into separate libraries and then add the files from the generated library into the main library. Change-Id: Idbd35510ccb8c9107b4de4199c8b1bcaa6f7a060 Reviewed-on: https://code.wireshark.org/review/25831 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-02-17Use -Werror except for explicitly listed dirty dissectors.Guy Harris1-1/+1
Use AM_CFLAGS for everything except for libdirtydissectors in epan/dissectors. Rename GENERATED_CFLAGS/GENERATED_CXXFLAGS to DIRTY_CFLAGS/DIRTY_CXXFLAGS, as it doesn't apply to all generated files. Change-Id: I702b53e185d6972c08d68ef31c05df7b03669daa Reviewed-on: https://code.wireshark.org/review/25829 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-16Add DIAG_OFF_FLEX and DIAG_ON_FLEX for use in Flex scanners.Guy Harris1-8/+8
DIAG_OFF_FLEX turns off all warnings that we want to disable for Flex-generated code due to some versions of Flex generating code that triggers those warnings. DIAG_ON_FLEX restores those warnings, so we do the checks for code that *we* wrote. Use them in .l files. Change-Id: I613a20309a30cd4c61111a1edbe27a5d05fcbf59 Reviewed-on: https://code.wireshark.org/review/25815 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-16Treat most Lex-generated and all Lemon-generated files as clean.Guy Harris1-12/+14
Now that we're suppressing warnings that come from Flex generating insufficiently fussy code, just treat many of the Lex-generated files as clean; we don't seem to be getting warnings from Lemon-generated ones. Change-Id: Ib53ced6d8cb80645234929afca343d047d30f7f7 Reviewed-on: https://code.wireshark.org/review/25813 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-08epan: use SPDX indentifiers.Dario Lombardo28-364/+28
Skipping dissectors dir for now. Change-Id: I717b66bfbc7cc81b83f8c2cbc011fcad643796aa Reviewed-on: https://code.wireshark.org/review/25694 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-11-29cmake: match include directories with autotoolsPeter Wu1-0/+2
Match closer the behavior of autotools which does not include epan in its include paths by default. Change-Id: I885bc7942490a5674c6ac75f9a8ea221555e3784 Reviewed-on: https://code.wireshark.org/review/24639 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Roland Knall <rknall@gmail.com>
2017-11-18autotools: Library build products don't need explicit cleaningJoão Valverde1-7/+0
Change-Id: I5d68c05f2844d6c9ae486531b189dbf10bc09cff Reviewed-on: https://code.wireshark.org/review/24484 Reviewed-by: João Valverde <j@v6e.pt>
2017-10-15autotools: make maintainer-clean should allow rerunning 'configure'João Valverde1-3/+1
Change-Id: Iedae94ffefe27b13b1967d69cacb757b5aa4576d Reviewed-on: https://code.wireshark.org/review/23928 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2017-10-15Remove superfluous null-checks before strdup/freeAhmad Fatoum1-1/+1
NULL checks were removed for following free functions: - g_free "If mem is NULL it simply returns" https://developer.gnome.org/glib/stable/glib-Memory-Allocation.html#g-free - g_slist_free(_full)? "NULL is considered to be the empty list" https://developer.gnome.org/glib/stable/glib-Singly-Linked-Lists.html - g_strfreev "If str_array is NULL, this function simply returns." https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html#g-strfreev - g_slice_free "If mem is NULL, this macro does nothing." https://developer.gnome.org/glib/stable/glib-Memory-Slices.html#g-slice-free - g_match_info_free "not NULL... otherwise does nothing" https://developer.gnome.org/glib/stable/glib-Perl-compatible-regular-expressions.html#g-match-info-free - dfilter_free defined in Wireshark code. Returns early when passed NULL epan/dfilter/dfilter.c They were also removed around calls to g_strdup where applicable: - g_strdup "If str is NULL it returns NULL." https://developer.gnome.org/glib/stable/glib-String-Utility-Functions.html#g-strdup Change-Id: Ie80c2db89bef531edc3aed7b7c9f654e1d654d04 Reviewed-on: https://code.wireshark.org/review/23406 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2017-10-13CMake: Allow user build flags to override default build flagsJoão Valverde1-1/+0
Autotools has the very useful feature by design of allowing the user to override the default build flags (you break it you keep it). Apparently CMake applies COMPILE_OPTIONS target property after CMAKE_{C,CXX}_FLAGS so that doesn't work here. Prepend our flags to those variables instead to make it work then. Specific target flag overrides can still be added with COMPILER_OPTIONS (e.g: generated files with -Wno-warning) but this is less effective and then we're back at the point where this overrides user flags. It's less of a concern though. Change-Id: I44761a79be4289238e02d4e781fef0099628817b Reviewed-on: https://code.wireshark.org/review/23675 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-09-19Disable flex-generated [-Wsign-compare] warningsJoão Valverde1-0/+4
Change-Id: Iace0462e6bb50573f3e4603f7a19e4b7ee1f9733 Reviewed-on: https://code.wireshark.org/review/23541 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2017-09-17CMake: Initial work to install headers for the benefit of pluginsJoão Valverde1-0/+11
To be continued incrementally to fix gaps and omissions. If we are willing to reorganize the source tree to have one or two header include folders this could be simplified considerably. It would also force developers to give more consideration to API issues, which is a good thing. See also e7ef19efc0e928b50644b37772ccbf176e74f766. Bug: 14062 Change-Id: I0759da2f9793cfb5cf92c9e231457bba43df4353 Reviewed-on: https://code.wireshark.org/review/23548 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2017-09-15epan: Fix misuse of comma operatorStig Bjørlykke1-1/+1
Change-Id: Ie088dea1239286cb413ddcfc2a82e4a5e3fb9e0f Reviewed-on: https://code.wireshark.org/review/23551 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-09-15autotools: Initial work to install headers for the benefit of pluginsJoão Valverde1-4/+11
Install public headers required to build plugins for libwireshark (taps and dissectors). The source tree is organized to serve the CLI/GUI parts of wireshark. Plugins are built in tree. This change is intende to allow plugins to be built out-of-tree but we want to avoid dumping all headers into /usr/include. To be continued incrementally to fix errors and omissions. Change-Id: Iaa0def0ba3de4b456a29114c315544d2d64fa748 Reviewed-on: https://code.wireshark.org/review/23374 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2017-09-06plugins: config.h must not be included by public headersJoão Valverde2-0/+3
For a sane plugin build environment. Include config.h as the first header in the .c file instead. Fix by moving required compiler attribute macros to a new "ws_attributes.h" API header. Change-Id: I34f58a927f68c1a0e59686c14d214825149749e1 Reviewed-on: https://code.wireshark.org/review/23400 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2017-06-01dfilter: fvt_cache use g_hash_table_new_full() API to prevent some memory leaksMax Dmitrichenko1-9/+9
Change-Id: I650c1eb1e98c7d2d2c9ec85bb6ec9b75667142a2 Reviewed-on: https://code.wireshark.org/review/21230 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2017-05-29Extend display filter len() to support all string and byte field types.Michael Mann1-5/+55
len() can now handle FT_STRING, FT_STRINGZ, FT_STRINGZPAD, FT_UINT_STRING, FT_BYTES, and FT_UINT_BYTES through the use of fvalue_length() Change-Id: I53baf2657f7804f64e63e4645d0b84b782ae9b08 Reviewed-on: https://code.wireshark.org/review/21775 Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-05-04dfilter: fix memleak when using value_string valuesPeter Wu1-0/+9
When using a filter such as "ncp.alloc_reply_lvl2 == FALSE", a memory leak would occur as follows: 1. dfilter_fvalue_from_unparsed is called and 2. ends up calling _uint64_from_unparsed 3. which fails with error message "\"FALSE\" is not a valid number.". 4. Next, mk_fvalue_from_val_string is called which maps "FALSE" to 0 5. and the filter is successfully compiled. 6. dfwork_free deliberately does not free the error message (since there should be none at this point) and we have a memleak (from 3). Fix this memleak by clearing the error message when a successful value_string mapping is found. Change-Id: I78d59a4336342b09dc5448ea994b2e1d199d7f3f Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=1302 Reviewed-on: https://code.wireshark.org/review/21497 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2017-04-12Rename routines to clarify what they do.Guy Harris1-1/+1
XXX_prime_with_YYY makes it a bit clearer than does XXX_prime_YYY that we're not priming YYY, we're priming XXX *using* YYY. Change-Id: I1686b8b5469bc0f0bd6db8551fb6301776a1b133 Reviewed-on: https://code.wireshark.org/review/21031 Reviewed-by: Guy Harris <guy@alum.mit.edu>