Commit Graph

11 Commits

Author SHA1 Message Date
João Valverde 5f79503d67 Fix config.h include order
The header "config.h" needs to be the first header included in the
source file, no exceptions.
2021-09-20 20:16:52 +01:00
João Valverde 0e50979b3f Replace g_assert() with ws_assert() 2021-06-19 01:23:31 +00:00
Moshe Kaplan e16166a74c Detect and replace bad allocation patterns
Adds a pre-commit hook for detecting and replacing
occurrences of `g_malloc()` and `wmem_alloc()` with
`g_new()` and `wmem_new()`, to improve the
readability of Wireshark's code, and
occurrences of
`g_malloc(sizeof(struct myobj) * foo)`
with
`g_new(struct myobj, foo)`
to prevent integer overflows

Also fixes all existing occurrences across
the codebase.
2020-12-22 14:56:38 +00:00
Dario Lombardo 084a887a30 Fix compilation with gcc-9.
gcc-9 spotted some NULL pointer usages.

Bug: 16319
Change-Id: I3e4ac57705f1852c43299f5e924fc642a2c56a3a
Reviewed-on: https://code.wireshark.org/review/35733
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-01-21 04:44:31 +00:00
Guy Harris 20800366dd HTTPS (almost) everywhere.
Change all wireshark.org URLs to use https.

Fix some broken links while we're at it.

Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c
Reviewed-on: https://code.wireshark.org/review/34089
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-26 18:44:40 +00:00
Guy Harris 69b5325044 Include transport protocols' hfids in the list of wanted hfids.
We need to get the fields corresponding to those protocols, so we know
the range within the packet that those protocols cover.

Improve a debugging message while we're at it.

Bug: 15208
Change-Id: Idc329079584e8d035622b148503a2ec1a295ccaa
Reviewed-on: https://code.wireshark.org/review/30280
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-10-20 08:57:41 +00:00
Peter Wu bb81e1807b Free g_ptr_array_free-related memory leaks
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-05-14 13:42:10 +00:00
Pascal Quantin 1eda133c36 MATE: fix compilation with gcc 8
mate_runtime.c:816:35: error: cast between incompatible function types from ‘void (*)(void *)’ to ‘void (*)(void *, void *)’ [-Werror=cast-function-type]
mate_parser.l:401:40: error: cast between incompatible function types from ‘void (*)(mate_config_frame *)’ {aka ‘void (*)(struct _mate_config_frame *)’} to ‘void (*)(void *, void *)’ [-Werror=cast-function-type]

Change-Id: I90fbed9c52f6fe43958a0ff11b21f0fe4c23c41a
Reviewed-on: https://code.wireshark.org/review/27267
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-05-02 21:04:43 +00:00
Stig Bjørlykke 488c831790 Use common indenting space in heading
Change-Id: I47022f9c7d568ca6d9705ba63c669a980822818a
Reviewed-on: https://code.wireshark.org/review/27229
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-05-01 06:55:55 +00:00
Dario Lombardo d2d1f793f8 plugins: use SPDX identifiers.
Change-Id: I8155573933daeb69c6e4c95c6702bdd6fc1fa89b
Reviewed-on: https://code.wireshark.org/review/25707
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-09 14:12:48 +00:00
João Valverde 5352ef42f9 plugins: Add source tree subfolder for plugin library
This allows some simplification and makes things more consistent,
particularly for loading plugins from the build dir.

Also fixes the issue reported here:

https://www.wireshark.org/lists/wireshark-dev/201801/msg00061.html

Change-Id: I0d8a000ee679172bccad546a3b0c47a79486f44d
Reviewed-on: https://code.wireshark.org/review/25329
Petri-Dish: João Valverde <j@v6e.pt>
Reviewed-by: João Valverde <j@v6e.pt>
2018-01-16 08:51:37 +00:00