Commit Graph

41705 Commits

Author SHA1 Message Date
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
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
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
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 95c7c1c0f2 kerberos: regenerate packet-kerberos.h.
We updated the template; regenerate the header.


(cherry picked from commit 7efb2120bc)
2021-03-16 22:42:49 +00:00
Guy Harris b5d65c0074 Move still *more* headers outside of extern "C".
If a header declares a function, or anything else requiring the extern
"C" decoration, have it wrap the declaration itself; don't rely on the
header itself being included inside extern "C".

(cherry picked from commit 2820156fbd)
2021-03-16 15:03:17 -07:00
Guy Harris f1f937dd26 Move more headers outside extern "C".
If a header declares a function, or anything else requiring the extern
"C" decoration, have it wrap the declaration itself; don't rely on the
header itself being included inside extern "C".


(cherry picked from commit 1e1f4e6b5f)
2021-03-16 11:21:16 +00:00
Michal Ruprich d0e6ad310b Moving glib.h out of extern C
(cherry picked from commit c8246c9973)
2021-03-16 02:07:58 -07:00
Alexis La Goutte 20a013b835 NAN(WiFi): Fix wrong variable size
NDPE Attribute is not dissected

Issue (and fix) reported by Darren Chen

Closed #17278


(cherry picked from commit 73de7b1325)
2021-03-12 12:14:28 +00:00
Alexis La Goutte fbbaa3d03d EAP: fix a memory leak
(cherry picked from commit 20a6fea312)
2021-03-12 08:52:21 +00:00
Dr. Lars Völker 3a657cb4fb TECMP: Adding missing reserved flag to timestamp (BUGFIX)
This patch fixes a bug in the current TECMP dissector that leads to
wrong timestamps, whenever the reserved flag is set to true.

Closes: #17279


(cherry picked from commit 5d709459c4)
2021-03-11 07:38:24 +00:00
Martin Mathieson 2f7cf6e528 DECT: "tranceiver" -> "transceiver"
(cherry picked from commit 933e7f5eb6)
2021-03-10 22:04:47 +00:00
Gerald Combs 45aed9966c Version: 3.4.4 → 3.4.5.
[skip ci]
2021-03-10 12:26:33 -08:00
Nardi Ivan 0de80702bd GQUIC: fix parsing of unknown (but valid) tags
This commit should be a proper fix for the regression reported in #17250
(7fd71536 is a simple workaround). Such regression has been introduced by
b287e716 while fixing the infinite loop reported in #16897.

b287e716, while fixing the infinite loop, broke the decoding of perfectly
valid tags not yet supported by Wireshark.

AFAIK, the root cause of the infinite loop is the overflow of the `offset`
variable. Therefore checking for this overflow should be sufficient to avoid
the loop.
Note that we already check for sensible values for the 'tag_len' variable;
we should update `total_tag_len` accordingly.

Some words about testing: other than correctly handling unknown but valid
tags, it is important that this commit doesn't reintroduce the infinite
loop bug.
Fortunately #16897 provided a POC trace. Unfortunately, if you revert
b287e716, this POC doesn't work anymore in master-3.4 and master branches,
but it still triggers the infinite loop in master-3.2 branch.
Therefore I have been able to manually check that this MR + the
overflow check is enough to avoid the infinite loop bug, at least in master-3.2.

Some traffic with unknown but valid tags is available in e2ee14ae03.


(cherry picked from commit 142cfb03ac)
2021-03-01 16:10:34 +00:00
Nardi Ivan 16bc7095b9 GQUIC: add decoding of CGST tag
Regression introduced by b287e7165e.

To avoid an infinite loop with malformed packets, that commit stops
parsing the tags list after finding an unknown tag.
When this "unknown" tag is perfectly valid but not supported by
Wireshark, we don't decode any subsequent (valid) tags anymore.

GQUIC is going to die soon and it is quite unlikely it will change in
the next future. Therefore the best/quick solution is simply decoding
any valid tag.

Close #17250


(cherry picked from commit 7fd7153696)
2021-02-24 19:45:30 +00:00
Guy Harris 4560ac0527 Lua: add routines to return pcap/nsec pcap/pcapng file type/subtypes.
These will be backported, for the benefit of Lua scripts that want those
specific file types/subtypes (typically in order to write files of those
types); that allows those types to be fetched without having to know the
right string to hand to wslua_wtap_name_to_file_type_subtype().

(cherry picked from commit bc3cc17bc4)
2021-02-23 00:10:40 -08:00
Gerald Combs 077a9c9354 [Automatic update for 2021-02-21]
Update manuf, services enterprise numbers, translations, and other items.
2021-02-21 10:31:58 +00:00
Gerald Combs 3fb8be3b91 NVMe Fabrics RDMA: Initialize a variable.
Make sure q_ctx is fully initialized. Fixes #17233.


(cherry picked from commit e29c934d72)
2021-02-16 08:49:37 +00:00
Gerald Combs b2c58d020c Be more strict about opening URLs.
In the proto tree, copy URLs instead of opening them.

In the export dialog, enable previews only if the advertised MIME type
*and* the contents of the file are plain text, GIF, JPEG, or PNG.

Add warnings to the wslua browser_open_url and browser_open_data_file
documentation.

Fixes #17232.


(cherry picked from commit e99c9afce8)
2021-02-15 16:50:02 +00:00
Chuck Craft 418c3360bf ip: ip_ttl _ws.expert fields not set if no tree
See 'if (tree) ...' comment
Closes #17228


(cherry picked from commit dde65b96cd)
2021-02-15 07:51:26 +00:00
Guy Harris 66e6f092f9 WSDG: deprecate wtap_filetypes.
Recommend the use of wtap_name_to_file_type_subtype() to get filetype
values, unless you need to run on older versions of Wireshark that don't
have it.

Don't even *mention* wtap_filetypes in the documentation for the new
wtap_ routines, as, if you have those routines, you have
wtap_name_to_file_type_subtype(), because it's one of those routines.

Fix references to "nul" while we're at it - it's "nil" in Lua.

(That part of the WSDG - the Lua reference - is generated, so this
involves changing the source code implementing the Lua routines.)


(cherry picked from commit 5b3c3d0682)
2021-02-14 06:35:08 +00:00
Jaap Keuter db364ed3d5 ASTERIX: fix dissection of I010_041 and I010_042 fields
Fixes #17226


(cherry picked from commit b9bdc803bb)
2021-02-13 14:52:33 +00:00
Guy Harris 3a60e4992d wslua: expose some libwiretap APIs in Lua.
Provide Lua version of wtap_file_type_subtype_string(),
wtap_file_type_subtype_short_string(), and
wtap_short_string_to_file_type_subtype().

This will be backported to the 3.2 and 3.4 branches, to allow scripts
not run on the bleeding-edge version to use them.


(cherry picked from commit f0ebc50762)
2021-02-13 05:48:04 +00:00
Gerald Combs 21f9f3f1f2 TShark: Load extcap preferences only when needed.
In our first pass through our options, look for ones that might require
extcap. Call extcap_register_preferences() only when that's the case.

Warn about missing extcap preferences only when we've loaded them.

(cherry picked from commit c7f66cf934)

Conflicts:
	tshark.c
2021-02-11 13:47:44 -08:00
Constantine Gavrilov 90ed3ff952 Fix dissection of transport connect payload for NVMEoF with RDMA.
(cherry picked from commit 28937e9022)
2021-02-11 10:17:39 +00:00
Harald Welte 5b97f29a9a packet-fr: Register for SLL dispatch to Frame Relay dissector
Without this patch, any Linux cooked packet capture on HDLC / frame
relay devices will not be dispatched to the proper dissector.

Such packets do carry a proper sll_hatype set to ARPHRD_FRAD and should
be dispatched accordingly.  However, the packet-fr dissector so far
did not register itself accordingly.


(cherry picked from commit b83f92a458)
2021-02-05 23:05:34 +00:00
Jaap Keuter d742da0e53 SIP: Fix header Id mapping
Fixes #17215


(cherry picked from commit 7401dbaa82)
2021-02-04 20:35:32 +00:00
João Valverde 003a730a20 Don't include config.h in system headers
Config.h must not be installed so configuration must be performed by client code.

Fixes #17190.


(cherry picked from commit 10178fdb09)
2021-02-03 14:56:33 +00:00
Jaap Keuter 49393cf362 S7COMM: remove array size from function interface
Fixes #17198


(cherry picked from commit 55d53dbf1b)
2021-02-03 08:22:49 +00:00
Dario Lombardo 39da36ad6e
ntp: remove size constraint for invalid refid.
When the refid contains non-ascii chars, the conversion function
returns a string longer than 4 chars. This results in an invalid
string if the output is limited to 4 bytes. Incidentally this
results in an invalid PDML output as well that caught this bug
in the first place.

Fix: #17112.
2021-02-02 11:36:27 +01:00
Gerald Combs 564a52be19 [Automatic update for 2021-01-31]
Update manuf, services enterprise numbers, translations, and other items.
2021-01-31 10:30:58 +00:00
Gerald Combs e0abfddcc5 Version: 3.4.3 → 3.4.4.
[skip ci]
2021-01-29 11:52:30 -08:00
Gerald Combs 57e14a4190 USB HID: Avoid allocating a huge amount of memory (second try).
10204490d7 / MR 80 ensured that we didn't grow field.usages due to an
underflow, but it neglected to check for a sane array size. Add another
check to make sure we don't wmem_array_grow() too much. Fixes #17165 and
fixes #16809 more completely.


(cherry picked from commit 785e291c1b)
2021-01-28 22:20:52 +00:00
John Thacker 247f8a4b33 USB HID: Usage Minimum and Usage Maximum are inclusive
Usage Minimum and Usage Maximum are an inclusive, closed interval.
This fixes an fencepost error where the Usage Maximum value was
not being included as a possible value in the bitfield. Related
to #17014


(cherry picked from commit 5ca608f519)
2021-01-28 21:55:50 +00:00
Jaap Keuter 935de5c4eb ZVT: clean up some data points
(cherry picked from commit b4f74bac74)
2021-01-28 11:49:03 +00:00
Guy Harris 1b22b8ed51 epan: don't print nanoseconds if seconds isn't representable.
Fix for previous fixes to #17179.


(cherry picked from commit 4715f5021c)
2021-01-28 08:18:16 +00:00
Guy Harris 9bcc1785c1 epan: don't use gmtime_s().
It has the "feature" that, if handed a negative value, it might just
exit.  gmtime() doesn't have that "feature", and is sufficiently
thread-safe for our purposes; use it instead, and check to make sure it
doesn't return a null pointer.

The previous fix for #17179 still used gmtime_s(); this doesn't, so it's
a better fix for #17179.


(cherry picked from commit bf265d7e7a)
2021-01-28 06:58:45 +00:00
Guy Harris e072a71256 epan: don't assume gmtime_s() or gmtime_r() succeed.
At least on Windows, gmtime_s() will *not* succeed if passed a negative
value.

Fixes #17179.


(cherry picked from commit 4e4a7c11c7)
2021-01-28 06:17:57 +00:00
Jaap Keuter 303a7cc58f ZVT: Use standard TCP segment reassemble support function
Fixes #17177


(cherry picked from commit 616d44cbb6)
2021-01-28 00:00:50 +00:00
Grzegorz Niemirowski cbdee60912 Fix TID bitmap name
(cherry picked from commit 6a860c979a)
2021-01-26 07:19:49 +00:00
Gerald Combs 24f56bec53 USB HID: Fix a memory leak.
Replace mismatched g_strdup() + g_free()s with
wmem_strdup_printf(wmem_packet_scope(), ...). Fixes #17124.


(cherry picked from commit 26f0db01a7)
2021-01-26 00:45:32 +00:00
Gerald Combs 2248cba00c [Automatic update for 2021-01-24]
Update manuf, services enterprise numbers, translations, and other items.
2021-01-24 10:30:17 +00:00
Jason Cohen c8bc83cb9e f5ethtrailer: Some trailers are not detected
This corrects 2 issues with the detection heuristic for f5ethtrailers
causing trailers to be missed.

Fixes #17171
Fixes #17172

(cherry picked from commit b297afee3e)
2021-01-22 08:58:34 -06:00
Jaap Keuter 227ed8cced FC ELS: Fix address length of FCWWN address in logout message
Closes #17168


(cherry picked from commit 13e04a2192)
2021-01-22 11:51:50 +00:00
Pascal Quantin 4ea329548c NAS 5GS: fix display of IPv6 interface identifier
Do not use FT_IPV6 as an interface identifier could be wrongly identified
as an IPv4-Compatible IPv6 Address format by inet_ntop() and displayed
as such.

(cherry picked from commit f64eddfd01)

Conflicts:
	epan/dissectors/packet-nas_5gs.c
2021-01-20 15:49:11 +00:00
Pascal Quantin 632df36405 NAS EPS: fix display of IPv6 interface identifier
Do not use FT_IPV6 as an interface identifier could be wrongly identified
as an IPv4-Compatible IPv6 Address format by inet_ntop() and displayed
as such.


(cherry picked from commit b794e4798a)
2021-01-20 15:28:41 +00:00
Guy Harris 79b075365f Don't dereference a known-to-be-null pointer.
In dump_dfilter_macro_t(), if the dfilter_macro_t pointer is null, just
give up after printing the message that indicates that.

This should squelch several nullPointerRedundantCheck warnings from
cppcheck.


(cherry picked from commit 05b9e53777)
2021-01-20 09:27:38 +00:00
Guy Harris 886465a976 Squelch "Clarify calculation precedence" warning from cppcheck.
For

        A & B ? C : D

put "A & B" in parentheses, to clarify the precedence.


(cherry picked from commit 138041b545)
2021-01-20 07:35:44 +00:00