Commit Graph

79283 Commits

Author SHA1 Message Date
Guy Harris d072335658 fuzzshark: close a leak.
If init_progfile_dir() fails, it returns a g_mallocated string with an
error message.  After printing the error message, free the string.


(cherry picked from commit c22b857942)
2021-05-22 02:57:49 +00:00
Guy Harris 0e6c7c7bb2 protobuf: close another leak.
Close the directory handle we've opened before returning a failure
indication if pbw_load_proto_file() or load_all_files_in_dir() reports a
failure.


(cherry picked from commit f0abd29e48)
2021-05-22 02:35:02 +00:00
Guy Harris 161e765500 protobuf: close a leak when file loading fails.
Free the path we've constructed before returning a failure indication if
pbw_load_proto_file() or load_all_files_in_dir() reports a failure.

Also, explicitly compare pbw_load_proto_file()'s return value against 0,
to make it a little clearer that it's *not* a Boolean, it's a return
code (with 0 meaning success and different non-zero values meaning
failure; if it matters *which* failure it is, we should probably have
otherwise we should just make it a Boolean).


(cherry picked from commit f1ffe7d421)
2021-05-22 02:02:52 +00:00
Nardi Ivan 4a17759938 QUIC: improve handling of unencrypted padding data
0af60377b4 added an heuristic to detect (unencrypted) padding data;
it is based on the fact that all coalesced QUIC packets must have the
same CID.
Unfortunately it doesn't work when the CID length is 0.

Treat decryption error of SH packets as a non fatal error, report them
as possible padding data misdetectd as coalesced packets and try
decrypting next traffic.

Close #17383

(cherry picked from commit 389a899a18)
2021-05-20 11:50:48 +00:00
Guy Harris dd0c60a001 AUTHORS.src: fix Jeffrey Wildman's entry.
[AT]ify his email address.

This should address the recently-added problem mentioned #16658.
2021-05-19 14:56:30 -07:00
Guy Harris 82b0eac6af PortsModel: don't populate it by doing a lot of weird string-pushing.
When enumerating port-to-name entries, the callback to
wmem_map_foreach() gets passed:

- a key, which is the port number for the entry;
- a value, which is a pointer to a structure containing pointers to port
names for various transport protocols;
- a user data pointer.

That's sufficient (if you work around some C++ annoyances) to append a
row to a PortsModel, if the user data pointer is a pointer to the
PortsModel.

The existing code, instead, appended to a QStringList of lines (in
effect, undoing the effort of the code that read the services file and
filled in the wmem_map, re-generating a set of lines) in the callback,
and then iterated over all the lines, splitting them with blanks and
appending rows.

Looking at that made my eyeballs bleed so badly that I decided not to
spend any time figuring out why it wasn't working.

So I just make the callback just append rows, avoiding all the
string-pushing.

Fixes #17395.


(cherry picked from commit 6e95a0aa47)
2021-05-18 09:41:00 +00:00
Gerald Combs 4a5dece155 [Automatic update for 2021-05-16]
Update manuf, services enterprise numbers, translations, and other items.
2021-05-16 09:53:30 +00:00
Gerald Combs 5254d5e822 Tools: Try to exit more gracefully from fuzzing.
If we catch a signal while we're fuzzing, exit with a successful status
and clean up after ourselves.


(cherry picked from commit dacbfc4ae9)
2021-05-11 18:23:15 +00:00
Gerald Combs b45185f1c0 [Automatic update for 2021-05-09]
Update manuf, services enterprise numbers, translations, and other items.
2021-05-09 09:53:41 +00:00
Gerald Combs 28aecbba66 GitLab CI: Set our Clang version. 2021-05-08 09:30:33 -07:00
Gerald Combs 728ae2de5f GitLab CI: Fix our fuzzing resource group. 2021-05-07 17:09:42 -07:00
Gerald Combs 2410d8b6eb GitLab CI: Add fuzzing to the 3.4 branch.
Backport part of d7bdd77a4c, which adds a -t option to
tools/fuzz-test.sh which lets you specify a maximum fuzz time.

Copy over the current (as of 7c6df3848f) fuzz jobs from the master
branch.
2021-05-07 14:09:10 -07:00
Gerald Combs 66cba93e39 GitLab CI: Give our jobs proper names.
GitLab's job YAML parser allows spaces in key names and our jobs are
visible in the web UI, so give them proper names.
2021-05-07 20:11:37 +00:00
Gerald Combs c1cf92283c GitLab CI: Restore the ability to run pipelines from the web UI.
(cherry picked from commit bedf0eb21c)
2021-05-07 19:26:51 +00:00
Gerald Combs 219978c50d GitLab CI: Miscellaneous updates.
Copy over various updates from the master branch including:

- Setting a git clone depth.
- Running manually in forks.
- Rule reuse.
- Using "extends" instead of YAML anchors.
2021-05-04 15:56:16 -07:00
Gerald Combs b191395e0e [Automatic update for 2021-05-02]
Update manuf, services enterprise numbers, translations, and other items.
2021-05-02 09:36:02 +00:00
Guy Harris 347f60c37b tap_export_pdu: we don't have packet flags, don't claim that we do.
We don't set rec.rec_header.packet_header.pack_flags, so don't set
WTAP_HAS_PACK_FLAGS in the presence flags.  (Copy-and-pasteo?)


(cherry picked from commit faf2e62db8)
2021-04-29 21:55:16 +00:00
Uli Heilmeier ab13858b7f PTP: Check for enough bytes
Make sure we have enough bytes for Length and Type fields before we read
from tvb.
Using existing msg_len for the checks.

Closes: wireshark/wireshark#17355


(cherry picked from commit fd14396972)
2021-04-26 14:11:04 +00:00
Gerald Combs aa169ab224 [Automatic update for 2021-04-25]
Update manuf, services enterprise numbers, translations, and other items.
2021-04-25 09:52:21 +00:00
Gerald Combs 31a3ec04a8 Version: 3.4.5 → 3.4.6.
[skip ci]
2021-04-21 11:56:15 -07:00
Gerald Combs 7db1feb42c Build: 3.4.5
[skip ci]
2021-04-21 10:14:36 -07:00
Gerald Combs 6548abd191 Prep for 3.4.5. 2021-04-20 11:21:00 -07:00
Gerald Combs 04f9d3e097 MS-WSP: Don't allocate huge amounts of memory.
Add a couple of memory allocation sanity checks, one of which
fixes #17331.


(cherry picked from commit b7a0650e06)
2021-04-20 16:05:59 +00:00
Gerald Combs 19d03ef4ac CMake: Enable AUTO{MOC,UIC,RCC} according to our CMake version.
As noted in be2b0fc810, we need to set CMAKE_AUTO* before searching for
Qt packages when using 3.20.0 and later. However, this fails if we're
using CMake 3.9.6 or earlier. Set CMAKE_AUTO* where needed depending on
our CMake version.

Ping #17314.

(cherry picked from commit a80ea46ff7)

Conflicts:
	ui/qt/CMakeLists.txt
2021-04-19 12:27:02 -07:00
naf eee907aeb5 QT ByteViewText: calculate string widths consistently to prevent clipping
For QT >5.11, stringWidth() uses horizontalAdvance, which gives different
(longer) widths than the old boundingRect().width() method.

Other locations use the boundRect().width() method directly, resulting
in underestimating line widths and clipping the last characters in
the byte view window.

Fix by forcing all width calculations to use stringWidth().
Closes #17087.

(cherry picked from commit 95f3d1b075)

Conflicts:
	ui/qt/widgets/byte_view_text.cpp
2021-04-19 20:08:17 +02:00
Gerald Combs cc954fae7e [Automatic update for 2021-04-18]
Update manuf, services enterprise numbers, translations, and other items.
2021-04-18 09:52:11 +00:00
Stefan Metzmacher e49430b4d3 packet-ldap: fix regression for SASL handling
commit 19b3376a24
("LDAP bogus malformed errors: decoding encrypted data")
introduced 2 problems:

- guint decr_len = tvb_reported_length(decr_tvb); was
  always called with decr_tvb==NULL

- dissect_ldap_payload() was not called if sasl_tree is NULL,
  it needs to be called even if the tree pointer are NULL
  in order to have the COL_INFO setup correctly.

I guess this should also be backported to stable branches
(together with 2e6d3b571b
 "LDAP: SASL Buffer doesn't include Length field")

https://gitlab.com/wireshark/wireshark/-/issues/17347

Signed-off-by: Stefan Metzmacher <metze@samba.org>


(cherry picked from commit 1d623fd541)
2021-04-16 11:53:00 +00:00
Uli Heilmeier 0c1743656f LDAP: SASL Buffer doesn't include Length field
SASL Buffer starts after the SASL Buffer Length field. Therefore
we should only mark the bytes without the Length field.

Sample capture can be found in wireshark/wireshark#15128


(cherry picked from commit 2e6d3b571b)
2021-04-16 11:03:16 +00:00
Simon Holesch d28ded7244 ptvcursor: Fix crash with deeply nested subtrees
If the proto tree is more than 8 levels deep, the subtree_lvl array
length is extended, by allocating a new area and copying everything into
that new area. However the old array length wasn't calculated correctly,
so only part of the subtree_lvl array was copied, causing a crash after
two ptvcursor_pop_subtree() calls.


(cherry picked from commit fa483ac191)
2021-04-16 07:44:56 +00:00
Michael Tuexen 489fc40a49 Fix conversation table when using epoch based time
Ensure that if using tshark -q -t e -z conv,tcp the reported
start time is relative to the epoch time and not relative to
the time of the first packet in the capture file.

Thanks to Theresa Enghardt for reporting the issue and to
Peter Lei for initialy looking into it.

(cherry picked from commit f099bd179a)
2021-04-15 14:27:02 +02:00
Gerald Combs cb432b878e [Automatic update for 2021-04-11]
Update manuf, services enterprise numbers, translations, and other items.
2021-04-11 09:53:17 +00:00
Guy Harris cdca1f2d03 pcapng: expand a comment and tweak the version test.
Drop in the comment from libpcap about version 1.2 (I wrote that
comment, and generously double-license it under the BSD license and the
GPL :-)).

Redo the version test as

    if (!({version is one we handle}))

to match the way it's done in libpcap.


(cherry picked from commit 7de6b0822a)
2021-04-09 06:31:05 +00:00
Loris Degioanni 716dd09605 sysdig: a couple more fixes
- parse the number of system call arguments in a way that works for both V1 and V2 event blocks
- returned the correct error string when unable to read the nparams entry from a sysdig event block V2

(cherry picked from commit 7894b1d0ea)
2021-04-08 22:09:56 -07:00
Loris Degioanni 4e7df5af01 sysdig: implementation fixes
- make sure nparams is initialized
- validate block_total_length in the correct way for sysdig event blocks

(cherry picked from commit cbbe660504)
2021-04-08 22:08:04 -07:00
Loris Degioanni 180c96beb8 sysdig: simplified the separate handling of the two different sysdig block types
(cherry picked from commit 8c70dd8d17)
2021-04-08 22:05:47 -07:00
Loris Degioanni e94d9f4549 sysdig: support the most recent version of sysdig
Update the pcap-ng reader and sysdig event dissector to support the second version of the sysdig event block, which was introduced after Wireshark's original implementation

(cherry picked from commit fbe8d3a00f)
2021-04-08 21:58:20 -07:00
Gerald Combs 1be17e2d30 GitLab CI: Switch to our new Windows runner.
(cherry picked from commit 85b36ef4b6)
2021-04-04 22:53:46 +00:00
David Perry f1677bd31c maxmind: add optional synchronous lookups
When tshark enables synchronous resolution of IP addresses to names,
forces calls to maxmind_db_lookup_ipv4()/_ipv6() to block-wait for the
maxmind response.

Proposed fix for #14691.

(backported from commit c0abaa06f7)
2021-04-04 02:16:48 -07:00
Vahap Emin Agaogullari 3e35fecccb PROFINET: Multiple write in record dissection
COContainerContent dissects PDInterfaceMrpDataAdjust and
PDInterfaceMrpDataAdjust dissects remaining COContainerContent
because of offset problem. Offset problem is fixed.

(cherry picked from commit ccec04ede0591a5e83d2664c26ed5cb4481a6809)
(cherry picked from commit ecbe04e0bbc6634eaa6c54968870fee61760107c)
2021-03-31 17:22:27 +00:00
Guy Harris 4a7ddb6b1a tvbuff_subset: fix its implementation of string scanning.
Both subset_find_guint8() and subset_pbrk_guint8() pass the parent
tvbuff to tvb_find_guint8()/tvb_ws_mempbrk_pattern_guint8(), along with
the offset in that tvbuff.

That means that the offset they get back is relative to that tvbuff, so
it must be adjusted to be relative to the tvbuff *they* were handed.

For subsets of frame and "real data" tvbuffs, there's a single lump of
data containing the content of the subset tvbuff, so they go through the
"fast path" and get the offset correct, bypassing the broken code;
that's the vast majority of calls to those routines.

For subsets of *composite* tvbuffs, however, they don't go through the
"fast path", and this bug shows up.

This causes both crashes and misdissection of HTTP if the link-layer is
PPP with Van Jacobson compression, as the decompression uses composite
tvbuffs.

Fixes #17254 and its many soon-to-be-duplicates.


(cherry picked from commit 2ba52cdc0e)
2021-03-29 01:20:38 +00:00
Gerald Combs 636f7f1c09 [Automatic update for 2021-03-28]
Update manuf, services enterprise numbers, translations, and other items.
2021-03-28 09:54:39 +00:00
Guy Harris 193b1fc545 wslua_tvb: correctly trim off the end of a tvbuff.
The length specified in a TvbRange is the *actual packet length*, not
the *sliced-to* length, so use tvb_new_subset_length() to cut it short.

This fixes the fix for #15655, and addresses at least some of the issues
in #17255.


(cherry picked from commit cda18f951e)
2021-03-28 03:01:34 +00:00
Gerald Combs 6ef6e8f607 CMake: Enable AUTO{MOC,UIC,RCC} earlier.
Enable CMAKE_AUTOMOC, CMAKE_AUTOUIC, and CMAKE_AUTORCC before searching
for Qt packages. This is apparently required for CMake 3.20.0 and later.
Fixes #17314.

(cherry picked from commit be2b0fc810)

 Conflicts:
	ui/qt/CMakeLists.txt
2021-03-26 14:50:21 -07:00
Nardi Ivan 3bca4e3b3f SMB2: fix two memory leaks
* Since c3342930 we don't free anymore the entries in the files hashtables.
The cleanest solution is probably to convert these hashtables into two
wmem_map_t structures and let the wmem core handling any cleanup.

* b0f5b2c174 added supported for chained compression; the uncompressed
tvb must be freed


(cherry picked from commit e677a909e1)
2021-03-25 16:01:01 +00:00
Uli Heilmeier 6b072b63f0 DNS: Fix pointer for is_multiple_responses
As discussed in wireshark/wireshark!2497 there is no need
for a pointer to a pointer.


(cherry picked from commit 337bdf8eb3)
2021-03-23 15:35:55 +00:00
Uli Heilmeier 06e20df535 DNS: IXFR/AXFR queries with multiple responses
IXFR and AXFR queries can have multiple DNS responses. As all responses
belong to one transaction, they have the same transaction ID.

We shouldn't handle them as retransmits.

Fix: wireshark/wireshark#17293
(cherry picked from commit 07fb47111e)
2021-03-23 11:49:13 +00:00
Guy Harris 878e8058a6 Do the LFS checks before processing any subdirectories.
That's necessary in order to make sure that the required -D flags show
up when building code from all subdirectories.

(cherry picked from commit 3f556a6e76)
2021-03-22 19:39:50 -07:00
Guy Harris d0fdecc6b6 Replace the Large File Support CMake stuff.
The existing stuff doesn't appear to work (I tried it on 32-bit Ubuntu
18.04, and it did *not* add any flags to the compilation, as it appeared
not to conclude that they were necessary, even though they were).

Pull in the stuff from libpcap, which *does* appear to work.  (it does
so in my 32-bit Ubuntu testing).

This should fix #17301.

While we're at it, fix cppcheck.sh so that it doesn't attempt to run
cppcheck on files that have been deleted.

(cherry picked from commit 0cc59d38ab)
2021-03-22 12:38:48 -07:00
Gerald Combs 76f01ea726 [Automatic update for 2021-03-21]
Update manuf, services enterprise numbers, translations, and other items.
2021-03-21 09:57:41 +00:00
Darius Davis b2d8858b9a Minor doc cleanups.
Here's a grab bag of trivial cleanup to the documentation.  This change:

- Cleans up some comments in the asciidoctor macros which are no longer
  accurate (and do not appear in the build products anyway).

- Fixes a missing space in the text "Wireshark Q&A" in the release notes.

- Allows the "docbook" backend to produce hyperlinks too... That seems to be
  necessary if we want to start using our custom link macros in WSDG, which
  seems like a reasonable thing to do.  And fixes up a wrong variable name in
  the handling of the case where we are not able to produce a hyperlink.


(cherry picked from commit 4c513fb4ab)
2021-03-20 17:31:42 +00:00