Commit Graph

41753 Commits

Author SHA1 Message Date
Martin Mathieson aa0f0f65e7 Snort config: Avoid leaks when fail to open config file.
CID: 1477713
CID: 1477850


(cherry picked from commit bbcd42be87)
2021-07-10 21:38:02 +00:00
Clément Notin bc38bea800 ldap: Add Active Directory OIDs
From [MS-ADTS] specification
https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/3c5e87db-4728-4f29-b164-01dd7d7391ea


(cherry picked from commit 5b248ac4d0)
2021-07-10 21:23:36 +00:00
Taisuke Sasaki fb2ed68545 OSPF: Fixed SRLB and SRMS Preference TLV types (rfc8665)
- Fixed TLV types of SRLB and SRMS Preference
- Added type/length for unknown Opaque RI TLV


(cherry picked from commit d8ee53e078)
2021-07-10 20:54:18 +00:00
Martin Mathieson 7799b0f577 RSL: Fix mask of eMLPP Priority field.
9.3.49 in 48.058wq


(cherry picked from commit ba0d6f69ab)
2021-07-10 20:25:10 +00:00
Alexis La Goutte cbbe611c7a dcerpc: Fix warning found by Clang Analyzer
packet-dcerpc.c:4381:17: warning: Assigned value is garbage or undefined [core.uninitialized.Assign]


(cherry picked from commit 558a32ba86)
2021-07-10 20:10:14 +00:00
ZhongYao Luo 2450e2220b Fix null pointer
In some cases, the fds parameter of frame_data_sequence_find is invalid,
causing the software to crash, For example, this command
echo'{"req":"frame","bytes":"yes","proto":"yes","frame":"1" }'|sharkd-


(cherry picked from commit 64155132ea)
2021-07-10 16:07:28 +00:00
Thomas Dreibholz 40496f3185 Bugfix for S101 dissector:
Make sure that the packet has an S101 header, before setting the protocol name
with col_set_str(). Otherwise, all TCP packets on port 9000 may be
misidentified as S101 packets.


(cherry picked from commit 8e256b7e69)
2021-07-10 11:20:13 +00:00
Pascal Quantin 490fe2684b DNP: use the proper free function
g618661b22e introduced a free for a so called memory leak (which wasn't
a real leak due to the pinfo->pool garbage collector) but used the wrong
free function. Let's keep the explicit free but use the right function.

Closes #17462


(cherry picked from commit 029a7fcec5)
2021-07-10 10:51:40 +00:00
Andreas Schultz be7bb332fe GTPv2: fix decoding of (extended) eNodeB id
3GPP TS 29.274, clause 8.21.7 and 8.21.8 clearly specify a total
length of 6 bytes for these fields.


(cherry picked from commit 4992806dba)
2021-07-10 09:53:44 +00:00
Prince Paul 3e42a64f6f ASTERIX: Fix Value of hf_010_202_VY from VX to VY
Fix typo VX to VY


(cherry picked from commit 79f62acbe7)
2021-07-08 17:59:06 +00:00
Prince Paul 3e836977cd ASTERIX: Fix Data Item 010/091
Fixed Item Number from 110 to 091


(cherry picked from commit 30058542e9)
2021-07-08 16:38:08 +00:00
Joakim Andersson 427cd8fd42 nordic_ble: Fix packet times for multiple interfaces
Fix packet times calculations when using multiple interfaces.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-07-08 08:15:21 +00:00
Joakim Andersson 3b330cf647 Bluetooth: Fix parsing of CTE Info field in extended advertising header
Fix parsing of the CTE Info field in the extended advertising header.
The bit-mask of the different fields was wrongly placed.
The text of the different fields all said "CTE Info".
The CTE Time field was added twice.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-07-08 07:23:07 +00:00
Joakim Andersson 4cbec00089 Bluetooth: Fix parsing of empty extendend advertising header
Fix parsing of extended advertising when the extended advertising header
is empty. The flag field is excluded when none of the fields are present
and the extended header length field is 0.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-07-08 07:23:07 +00:00
Joakim Andersson de9d5f76ff bluetooth: Fix sync info in extended advertising header
Fix the sync info field length in extended advertising header set to the
wrong length.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
2021-07-08 07:23:07 +00:00
Gerald Combs bf35c11265 [Automatic update for 2021-07-04]
Update manuf, services enterprise numbers, translations, and other items.
2021-07-04 16:12:00 +00:00
Pascal Quantin 9b21140c8e NR RRC: fix dissection of MeasTriggerQuantityOffset element
(cherry picked from commit aa5df68171)

Conflicts:
	epan/dissectors/packet-nr-rrc.c
2021-07-04 13:12:53 +02:00
Gerald Combs 2d967ebad1 [Automatic update for 2021-06-20]
Update manuf, services enterprise numbers, translations, and other items.
2021-06-20 09:54:06 +00:00
Guy Harris 18c4baa9f3 wslua_tvb: fix documentation for reported_length_remaining().
In the past, tvb_reported_length_remaining(), and thus
Tvb:reported_length_remaining(), may have returned -1 if the offset was
invalid.  That's no longer the case; the former returns 0, and, as the
latter just returns the former's return value, that's true of the latter
as well.


(cherry picked from commit 6c043d5c73)
2021-06-16 08:04:07 +00:00
Guy Harris 18e13337ea wslua: a tvbuff doesn't have an "actual length".
It has a "reported length", which is the closes thing to an "actual
length", as it represents the length the packet, or subset thereof, had
on the network, and a "captured length", which is the amount of the
packet that the capture process saved.

In 99.999999999999999999999999999999% of all cases, a dissector should
look at the "reported length", not at the "captured length".

Rename the "len" method to "captured_len", leaving "len" around for
backwards compatibility.

Fix the documentation to reflect reality, to avoid issues such as #15655.


(cherry picked from commit bd9ceaebef)
2021-06-16 07:31:22 +00:00
Gerald Combs 9ea88b3ee2 [Automatic update for 2021-06-13]
Update manuf, services enterprise numbers, translations, and other items.
2021-06-13 09:53:07 +00:00
Alexis La Goutte 64bedfad27 wifi-nan: Fix length for availability attribute
Issue reported by Behzad Mokhtari

Fix #17431


(cherry picked from commit b716e2f1a2)
2021-06-10 06:27:41 +00:00
Christian Reusch 9eb1c665c6 tcp: Fix dissection of DSACK
DSACK blocks (the first SACK block in a TCP SACK option, with right edge
being lower or equal to the ACK filed) are now identified correctly.

Closes #17315


(cherry picked from commit 7179e1d1fb)
2021-06-05 10:17:05 +00:00
Guy Harris 57776c7641 file-pcapng: fix name of expert info.
The entry was copied and pasted, and the variable name and descriptive
text were changed, but the field name wasn't.


(cherry picked from commit deb6786ed4)
2021-06-04 22:11:44 +00:00
Simon Barber 793d971db2 ieee80211_radio: Use calculated bitrate if not supplied
For 802.11n if the bitrate is not supplied then the calculated bitrate is used. This change does the same for 11ac and 11ax.

Sniffer traces taken on recent versions of Macos no longer supply the bitrate for 11ac frames in the RADIOTAP header, this change allows the wireless timeline to work with these traces.

Fixes #17419.


(cherry picked from commit 5202119239)
2021-06-02 21:48:43 +00:00
Gerald Combs fd6a83dfec Version: 3.4.6 → 3.4.7
[skip ci]
2021-06-02 12:23:39 -07:00
Guy Harris 65a554b976 pcapng: set the length of the options item.
It runs up to either the end of the option data or the terminating
end-of-options option (readers MUST handle lists of options that
contains an end-of-options option and lists of options that don't).


(cherry picked from commit 2f5c0ffdb2)
2021-06-02 02:17:03 +00:00
João Valverde 7308ab766b dfilter: Fix handling of escaped quotes in macros
We can't unescape characters when expanding a display filter macro.
The escaping must be preserved until the expression is evaluated in
the display filter engine, otherwise it will likely generate a syntax
error in the parser.

In the macro body we allow '$' (or any other char) to be escaped
with backslash (preserving the backslash).

Fixes #17160.


(cherry picked from commit 1dba58789d)
2021-05-28 11:17:03 +00:00
John Thacker 0d8be1fb79 DVB-S2-BB: Prevent infinite loop
Commit 4bf4ee88f0 removed an else
statement that broke out of the BBFrame processing loop. Without
it, infinite loops might be possible if the GSE frames have bit errors
in the length field.


(cherry picked from commit 0137c24d60)
2021-05-26 04:54:11 +00:00
John Thacker b20a77698d ftype-protocol: Fix crash when comparing _ws.expert to literals
The ftype-protocol has two components to its value - a tvb, which is
allowed to be be NULL (most notably in _ws.expert), and a string
description. They can also be created from string literals, such as
in display filters. It's possible to compare protocols with a NULL
tvb with protocol terms created from literals, e.g. entering the
display filter "_ws_expert < 1".

Partially revert 69e2603c48 so that
this doesn't crash, by assigning proto_string to the empty string
instead of null when creating from a literal. Fixes #17316


(cherry picked from commit 31297dbb82)
2021-05-25 23:09:21 +00:00
John Thacker ffe59d91a1 RANAP: Don't attempt to re-register heuristic dissectors
Move the RANAP heuristic dissector registration under the initialization
guard that they're only registered once. Prevents console warnings about
the dissectors already being registered to the sccp and sua tables if
a RANAP preference is changed. (Backported manually to regenerate the
dissector via asn2wrs.py)
2021-05-24 19:43:20 -04:00
Guy Harris 7c969e2deb tacacs: free a buffer if it's not used.
Plugs a leak.


(cherry picked from commit 1bb64b7e0c)
2021-05-24 00:28:05 +00:00
Guy Harris f032d776e6 dnp: plug a memory leak.
If we're throwing away the data, *throw away the data* - free it, as
we're not using it as the backing data for a tvbuff.


(cherry picked from commit 618661b22e)
2021-05-23 22:08:25 +00:00
Gerald Combs 191e6744f9 [Automatic update for 2021-05-23]
Update manuf, services enterprise numbers, translations, and other items.
2021-05-23 16:20:18 +00:00
Guy Harris ecf1616e35 OID handling: fix a memory leak.
There's a "break" in some code that appears to be copied and pasted from
a switch statement; the break would exit the loop (and leak memory
allocated within the loop), which does not appear to be the intent, so
it may have been copied over incorrectly.  Remove it.

While we're at it, redo the "constant-time append to the end of a loop"
code to be a bit clearer, both to humans reading the code and code
analyzers reading the code.


(cherry picked from commit c73ab16bef)
2021-05-23 09:54:43 +00:00
Guy Harris faea31d0a1 epl-profile-parser: plug a memory leak.
g_key_file_get_groups() returns a pointer to g_mallocated data; we need
to pass its return value to g_strfreev() when we're done with that data,
to free it up.


(cherry picked from commit 64f3f08702)
2021-05-23 07:27:31 +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
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 31a3ec04a8 Version: 3.4.5 → 3.4.6.
[skip ci]
2021-04-21 11:56:15 -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
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
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
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 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
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