Commit Graph

74337 Commits

Author SHA1 Message Date
Peter Wu 1527177cb9 TCP: pass data after a ZeroWindowProbe to subdissectors
If the single byte within a ZeroWindowProbe triggers reassembly within a
subdissector, a new MSP will be created with just a single byte. Be sure
not to mark subsequent segments that contain the full segment data as
retransmission as this prevents the subdissector from seeing the data.

Bug: 15427
Change-Id: I36ae2622689c6606c99cdff70b6beba4b9d25ca7
Reviewed-on: https://code.wireshark.org/review/31732
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jasper Bongertz <jasper@packet-foo.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-27 09:47:54 +00:00
Peter Wu 596f538b5b TCP: do not mark data following a ZeroWindowProbe as retransmission
The single byte within the ZWP could be retransmitted with the next
segment, this is perfectly acceptable behavior. Do not flag these new
segments as retransmissions or Out-Of-Order.

Bug: 15427
Change-Id: I76db2b7a2b684c8c78fa24c9c4b457e1833d12b7
Reviewed-on: https://code.wireshark.org/review/31731
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jasper Bongertz <jasper@packet-foo.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-27 09:47:44 +00:00
Peter Wu 089d7a05c8 doc: update sshdump manual to reflect the current state
Option --extcap-interface=ssh seems to give an error, update it.
Note that --remote-capture-command overrides other options. Perhaps some
form of template should be supported, but that is currently not
implemented.

Change-Id: Iee132941a460afca91e73cf3e3ec3501dc15f14d
Reviewed-on: https://code.wireshark.org/review/31753
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-27 09:46:59 +00:00
Peter Wu 62ffa95707 sshdump: leave username, port and interface unset by default
If the username or port number are unspecified, libssh will pick an
appropriate default (the local username or port 22 respectively).
Additionally, it will use the ssh config file if possible.

The eth0 interface is not always appropriate. If the -i option is not
specified, tcpdump will select an appropriate default.

Change-Id: I99d2136ab27d1652bb420f44d16df063030fb9ce
Reviewed-on: https://code.wireshark.org/review/31752
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-27 09:46:55 +00:00
Peter Wu 50fb318026 tshark: fix minor memleak of the interface description
Capturing with "tshark -i lo" results in capture_opts->descr being set
to "Loopback" via:

    #3 0x55c5f575720c in fill_in_interface_opts_from_ifinfo capture_opts.c:547:33
    #4 0x55c5f5750dc5 in capture_opts_add_iface_opt capture_opts.c:695:9
    #5 0x55c5f574b6bd in capture_opts_add_opt capture_opts.c:843:18
    #6 0x55c5f5785efc in main tshark.c:1087:21

but tshark overwrites it, presumably to offer textual descriptions like
"Standard input" for "-i -". Fix this memory leak, reported by ASAN for
three tests from case_tshark_capture that capture from Loopback.

Change-Id: I4f393c4440bde7a621271cca3066bef3d57e250a
Reviewed-on: https://code.wireshark.org/review/31756
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-27 09:43:55 +00:00
Peter Wu e3a9cc6761 wslua_pinfo: fix memleaks on setting addresses in Pinfo
Fixes memory leaks reported by ASAN for the test_wslua_pinfo test.

Change-Id: Id7e79e63559db1e7f8b27d566048eab9268d9237
Reviewed-on: https://code.wireshark.org/review/31754
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-27 09:43:44 +00:00
Peter Wu 79fef2ae50 wslua: fix memleak of unregistered ProtoField field
If a ProtoField object was created, but not linked to a Proto, then some
fields (name, abbrev, blob) could leak. Fixes ASAN test failures for
four wslua tests.

Change-Id: I570ea154153b505ba81edb2bbf538e6dc1438728
Reviewed-on: https://code.wireshark.org/review/31750
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-27 09:43:26 +00:00
Peter Wu 03e13a6a9f wslua: fix memleaks related to Proto and Pref
Proto objects were only freed while reloading Lua plugins, be sure to
release these on program exit too. Fix missing deallocation of heur_list
(matches per-protocol cleanup in proto_cleanup_base).

Be sure to keep a reference to the "Pref" object after registering it to
a Proto, otherwise it could be garbage-collected early, resulting in
memleaks (because the preference was still in use).

Fixes a lot of memory leaks reported by ASAN for tests, ten tests were
affected by Proto_new leaks, four were affected by the new_pref leaks.

Change-Id: Ica52718849a33eda614775f533dc0fcefec9cc74
Reviewed-on: https://code.wireshark.org/review/31746
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-27 09:43:05 +00:00
Peter Wu 311d087bbd wslua_listener: fix memleak in tap packet callback
Addresses memleaks reported by ASAN for:

    test_wslua_listener
    test_wslua_nstime
    test_wslua_pinfo
    test_wslua_field

Change-Id: I221382844ee0bfd7ffc274bbb27eded0e221f9cf
Reviewed-on: https://code.wireshark.org/review/31742
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-27 09:40:56 +00:00
Gerald Combs a1ee099ffa [Automatic update for 2019-01-27]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I2a887e9f0d6aa73fee4046a77271a55be48b1864
Reviewed-on: https://code.wireshark.org/review/31759
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2019-01-27 08:30:32 +00:00
Peter Wu 141f6d8df9 wslua_field: fix memory leaks in Field_new
Change the "Field" type to actually point to a structure. Do not cheat
and overload the pointer to mean "char*" in one context, and
"header_field_info*" in another. It was very confusing.

Implement Field__gc to free the Field structure that was allocated in
Field_new. This fixes the memory leak in Field_new.

Now the test_wslua_field test passes when executed with ASAN and a bunch
of other wslua tests also improve.

Change-Id: Ibc4318b76bb893151fd40c3fbc595402fba7a60a
Reviewed-on: https://code.wireshark.org/review/31743
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2019-01-26 19:43:05 +00:00
Pascal Quantin 14d5ab01c0 SMB2: ensure that preauth_hash_current pointer is always initialized
Bug: 15446
Change-Id: I9c233ee327dd40d1ae2dd076a2e236c6f23ae5e2
Reviewed-on: https://code.wireshark.org/review/31741
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2019-01-26 10:51:39 +00:00
Peter Wu 6fbf28f3b8 wslua_nstime: fix memleak for bad arguments to NSTime
luaL_optinteger will raise an error when the argument is an invalid
number. Delay the allocation to avoid a leak. Fixes the
test_wslua_nstime test under ASAN.

Change-Id: I6856fd218897565a60786d820f43192b41d489f2
Reviewed-on: https://code.wireshark.org/review/31744
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-26 09:07:32 +00:00
Peter Wu ae6b585d51 ISAKMP: fix memory leaks for IKEv1 decryption
Fixes leaks of allocations from dissect_key_exch as detected by ASAN
while running the following tests:

    test_ikev1_simultaneous
    test_ikev1_unencrypted
    test_text2pcap_ikev1_certs_pcap
    test_ikev1_certs

Change-Id: Ifc102539efadd33d1b9d9921bcdbb35dfd31927f
Fixes: acfe071eb6 ("Add decryption support.")
Reviewed-on: https://code.wireshark.org/review/31740
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-26 07:43:10 +00:00
Peter Wu 0b632861e2 dumpcap: fix memory leak in ringbuffer mode
'save_file' is used both for holding the -w command-line argument as
well as the current filename that is being written. In ringbuffer mode,
the former is already freed while the latter changes after rotation. Be
sure to free all ringbuffer filenames on exit.

Fixes test failures due to ASAN reporting memory leaks for:

    test_dumpcap_ringbuffer_filesize
    test_dumpcap_pcapng_single_in_multi_out
    test_dumpcap_pcapng_multi_in_multi_out
    test_dumpcap_ringbuffer_packets

Change-Id: Ib817d8340275d7afa7e149dcfbbc59ed78293c34
Reviewed-on: https://code.wireshark.org/review/31739
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-26 07:42:17 +00:00
Peter Wu 728183c27e wslua_file_handler: fix leak of opt_comment
Since v2.9.1rc0-528-g31aba351e2, it is clear that wtap file formats
should free earlier comments before writing a new one. Do so.
Fixes leaks reported by ASAN for test_wslua_file_acme_reader.

Change-Id: Iafb643f01f5973f2d3b88f244ee70e8c0c451080
Reviewed-on: https://code.wireshark.org/review/31738
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-26 07:42:00 +00:00
Anders Broman 3ee9c0facf GTP: Dissect PDU Session Container.
Change-Id: I4022d1d47aeaaa4a4d3d51c365bd8fad138a8e97
Reviewed-on: https://code.wireshark.org/review/31735
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-25 20:41:21 +00:00
Aurelien Aptel d09d33262b test/suite_decryption.py: add smb2 decryption tests
add 3 tests and 2 sample captures to check smb2 decryption with:
- bad key (should fail gracefuly)
- smb3.0 AES-128-CCM
- smb3.1.1 AES-128-CCM

Change-Id: I099f5f00f83fd39ac6de9ce9ce374624297aef61
Reviewed-on: https://code.wireshark.org/review/31728
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-25 16:07:52 +00:00
Pascal Quantin 75484b106d ETSI CAT: do not call tvb_bytes_to_str() with a 0 length
Change-Id: Ibd8ebe801a7bb0196e9d0f8e1c19cc16050a4f60
Reviewed-on: https://code.wireshark.org/review/31733
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2019-01-25 15:55:05 +00:00
Anders Broman 38ee25b3f5 nas5gs: v15.2.1 Updates and corrections
- Update the IE paragraph references
- Don't dissect encrypted messages
- Introuduce preference to force dissection of encrypted messages a
s plain.
- Fix idssection of Tracing area.
- Dissect Replayed S1 UE security capabilities.

Change-Id: If3dce4c34cbd72b1d8afd0079b81c719a7e94598
Reviewed-on: https://code.wireshark.org/review/31730
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-25 13:02:03 +00:00
Peter Wu 0b9b531726 tcp: fix reporting of "Reassembled in" for OoO initial segment
When the initial segment is OoO, it was recognized as retransmitted. Fix
this by remembering which frame actually contains the initial segment.

Bug: 15420
Change-Id: If63e2ff581775ff9d396a612839f1bfab30f111f
Reviewed-on: https://code.wireshark.org/review/31720
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-25 12:01:32 +00:00
Joakim Karlsson 394e39117f pfcp: Improved printout on some IEs
Change-Id: I98599f3c990a3b446b8080a24002371b5cf1a98b
Reviewed-on: https://code.wireshark.org/review/31718
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-25 11:18:16 +00:00
Peter Wu 31aba351e2 wiretap: fix memleaks with wtap_rec::opt_comment
The memory ownership of wtap_rec::opt_comment was not clear. Users of
wtap were leaking memory (editcap.c). wtap readers were not sure about
freeing old comments (erf) or simply ignored memleaks (pcapng).

To fix this, ensure opt_comment is owned by wtap_rec and free it with
wtap_rec_cleanup. The erf issue was already addressed since
cf_get_packet_comment properly duplicates wth.opt_comment memory.

- wtap file formats (readers):
  - Should allocate memory for new comments.
  - Should free a comment from an earlier read before writing a new one.
- Users of wth:
  - Can only assume that opt_comment remains valid until the next read.
  - Can assume that wtap_dump does not modify the comment.
  - For random access (wtap_seek_read): should call wtap_rec_cleanup
    to free the comment.

The test_tshark_z_expert_comment and test_text2pcap_sip_pcapng tests now
pass when built with ASAN.

This change was created by carefully looking at all users opt
"opt_comment" and cf_get_packet_comment. Thanks to Vasil Velichkov for
an initial patch which helped validating this version.

Bug: 7515
Change-Id: If3152d1391e7e0d9860f04f3bc2ec41a1f6cc54b
Reviewed-on: https://code.wireshark.org/review/31713
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Vasil Velichkov <vvvelichkov@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-25 04:53:10 +00:00
Peter Wu 66345f008f Fix memory ownership when using cf_get_packet_comment
cf_get_packet_comment already has one code path that returns duplicated
memory. Be sure to document the requirement to free this memory and
adjust Qt to avoid memory leaks.

Be firm and assume that wth.opt_comment is owned by wth, so duplicate it
before returning it from cf_get_packet_comment.

Change-Id: I91f406296c9db5ea21b90fc2e108c37de4528527
Ping-Bug: 7515
Reviewed-on: https://code.wireshark.org/review/31712
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Vasil Velichkov <vvvelichkov@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-25 04:53:01 +00:00
Peter Wu e85c8bed87 tshark: fix crash with -Tjson and -e field
Fix the assertion to check for the actual requirements. Add tests for -T
combined with -e.

Bug: 15444
Change-Id: I83e7663572db0c60194f6d6128b9e1ae7396b3f6
Fixes: v2.9.1rc0-226-g30c90fa745 ("epan: use json_dumper for json outputs.")
Reviewed-on: https://code.wireshark.org/review/31724
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-24 22:20:13 +00:00
Aurelien Aptel d3f1e2fa19 smb2: cleanup
* remove _U_ unused attribute for used args
* no need for gcry_err_code() for success

Change-Id: I4c629657328506255da066671b69a98d0f088a3b
Reviewed-on: https://code.wireshark.org/review/31729
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-24 22:16:21 +00:00
Uli Heilmeier 7ef8ddcad4 CoAP: Add RFC8516 response code
RFC8516 adds new response code 4.29

Change-Id: I4a1d57a0632939d0b59a7f625720d07be3cdb866
Reviewed-on: https://code.wireshark.org/review/31719
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2019-01-24 22:14:27 +00:00
Peter Wu 50639e9243 dumpcap: fix memleak if multi_files_on is enabled
Capture tests fail under ASAN due to leaking capture_opts->save_file.
Since v2.9.0rc0-1493-g787d61c0a4, capture_opts_cleanup takes care of
freeing "save_file", so avoid clearing the pointer.

Change-Id: Ice90efe0959cc8016f47db20970bd2397909e28d
Reviewed-on: https://code.wireshark.org/review/31727
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2019-01-24 21:25:42 +00:00
Martin Boye Petersen f51821af86 ZigBee: Changed file offset from BASE_HEX to BASE_DEC
The change aligns this field with the image size and data size fields,
which are also shown as decimal.

Change-Id: I0e34a2742ae3d18c7b2501e895406f4b416a9ca6
Reviewed-on: https://code.wireshark.org/review/31717
Reviewed-by: Kenneth Soerensen <knnthsrnsn@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-24 20:05:52 +00:00
Nicolas Bertin 66819a619a ua3g: updated freeseating message decoding to handle the "do_reset" parameter
Change-Id: I66bfed59301a6f149819b345d03c534993f36948
Reviewed-on: https://code.wireshark.org/review/31711
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-24 19:30:07 +00:00
Aurelien Aptel bf208ab000 smb2: add NULL checks
in incomplete traces, the saved packet data (ssi) might be NULL. This
would trigger segfaults.

Sample problematic capture:

https://wiki.wireshark.org/SampleCaptures?action=AttachFile&do=get&target=smb-on-windows-10.pcapng

Change-Id: I3e40efa34396d2ffe5bd75fb4250c7ccf0cb6b93
Reviewed-on: https://code.wireshark.org/review/31722
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-24 18:38:26 +00:00
Peter Wu 557607271a EPL: fix build with incomplete libxml2 library
HAVE_LIBXML2 can be set while PARSE_XDD is unset, resulting in missing
functions and linker errors.

Bug: 15419
Change-Id: I0aa20a80080d159bfb6eebccc503b66cc148f7f8
Reviewed-on: https://code.wireshark.org/review/31715
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2019-01-24 18:24:19 +00:00
Peter Wu 0f4161a48c tcp: mark units_64bit_version as static
Addresses a -Wmissing-variable-declarations warning from Clang.

Change-Id: I04de4b2017a61f9e605892338426b1a49042671f
Fixes: v2.3.0rc0-1774-g8efb7fece1 ("Adjust proto_tree_add_xxx_format_value calls to use unit string")
Reviewed-on: https://code.wireshark.org/review/31721
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-24 18:24:15 +00:00
Peter Wu 198c5a2cac test/dfilter: be explicit with the expected error message
Instead of just reporting a mismatching error code, include the program
output. This should help tracking down unexpected errors. While at it,
check the expected error message too.

Change-Id: Ib8fe51cc06b795bb54bfe1e6eaa828c6ba1128ef
Reviewed-on: https://code.wireshark.org/review/31714
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-24 18:24:00 +00:00
Peter Wu a946eb3141 ftype-time: parse the month independent of the locale
Do not rely on strptime("%b") to parse the month, it does not correctly
recognize English month abbreviations on non-English systems. While at
it, do not try to parse milliseconds if seconds are missing.

Change-Id: Ia049bf362195eef1eba2f04ff7217049fa6a7d9d
Reviewed-on: https://code.wireshark.org/review/31707
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-24 09:20:10 +00:00
Peter Wu 044a9deeca tvbuff: Fix RFC 822 and 1123 date parsing with non-English locales
Avoid relying on strptime to parse the day of week (%a) and month name
(%b) since these are locale-dependent. Fixes test suite failures with
tvb.lua and LC_ALL=nl_NL.UTF-8.

Additionally it will now reject four-digit years when using ENC_RFC_822
as that requires two digit years. The only user of this API seems to be
the Lua tests though, so this should not make much of a difference.

Bug: 15437
Change-Id: I75436b93faab23869794d9756b9c3ce6128dd1f4
Reviewed-on: https://code.wireshark.org/review/31698
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-24 09:19:51 +00:00
Guy Harris 4f8b3f3d2a By default, don't stop after a read error.
For close to 10 years, we have defaulted not to stop processing on an
open error; default not to stop processing on a read error, either.  -C
causes us to stop for both.

Bug: 15433
Change-Id: I5cd239c160d0ff85eb0425ca4b172532a4659fd3
Reviewed-on: https://code.wireshark.org/review/31710
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-01-24 06:42:58 +00:00
Goldman, Adam 5d38999b57 opa-mad: Fix PortSelectMask parsing to common function
Added Common function to convert 256-bit Port Select Mask into a range
string (e.g. "1-3,5-8,10").

Used wmem_strbuf API to allocate range string.

Change-Id: I70d737d1a33e84c7961eaf0bf83a1bc0689380a1
Signed-off-by: Adam Goldman <adam.goldman@intel.com>
Reviewed-on: https://code.wireshark.org/review/28506
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-24 04:22:46 +00:00
Peter Wu 9d5ab21163 wiretap: fix leak of options_buf and document memory handling
Manually checked all callers of wtap_seek_read to ensure that
wtap_rec_cleanup is called. Added missing wtap_rec_cleanup to:
- Completion of sequential read: wtap_sequential_close
- Callers of wtap_seek_read:
  - users of cf_read_record_r:
    - PacketListRecord::dissect

This fixes one of the two ASAN memleak reports while running
test_tshark_z_expert_comment and test_text2pcap_sip_pcapng (the other is
about opt_comment which is still unfixed).

Vasil Velichkov also found this issue and came up with a similar fix.

Change-Id: I54a6aa70bfdb42a816d03ad4861d0ad821d0ef88
Reviewed-on: https://code.wireshark.org/review/31709
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-24 04:21:23 +00:00
Peter Wu 9175a235a8 travis: enable capture tests on Linux and macOS
Windows is excluded because installing Npcap is potentially difficult.
On macOS use ChmodBPF to create more than 4 bpf devices. This fixes
timeout issues in the case_wireshark_capture test due to an error dialog
about permissions.

Change-Id: I4cfd9618df96a3d6ae4bb2ce0229e9c2c3cccaed
Reviewed-on: https://code.wireshark.org/review/31683
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-24 00:26:28 +00:00
Peter Wu cbb5b78a7d test,travis: dump a screenshot for hanging GUI tests
For some reason the wireshark GUI tests hang on the Travis OS X builds,
but I could not reproduce it locally. It turns out than an error dialog
was present, but I could not know that without the screenshot.

Change-Id: Idf897d33b4fddf3c19c69ebcea60b629f1ca9368
Reviewed-on: https://code.wireshark.org/review/31682
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-24 00:26:22 +00:00
Peter Wu 8c698ffc99 Test: enable capture tests by default using the Loopback interface
Avoid pinging www.wireshark.org, this removes an external dependency.
Instead send small UDP datagrams to UDP port 9 (discard) every 50ms.

Enable this for all platforms (including macOS and Linux) by default.
On Windows the tests requires Npcap and will be skipped with WinPcap.
Remove the --capture-interface option since it is no longer needed.
Copy WSDG Wireshark Tests Quick Start to README.test and add a link.

Change-Id: Id4105a6b1e95407ebf69b871c785c68f9ae26368
Reviewed-on: https://code.wireshark.org/review/31677
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-24 00:26:17 +00:00
Martin Mathieson e351395339 DCT2000: Add other NR RRC entry points.
Some of the PDU types needed for SA
were missing in earlier RRC versions.

Change-Id: Ida3b091fe91961cf3cd8e7476692d2467211b5fd
Reviewed-on: https://code.wireshark.org/review/31703
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2019-01-23 21:45:49 +00:00
Jaap Keuter 3c1342291f text import: cleanup type usage
The glib gboolean and integer types are used interchangably,
while a proper use is easily achievable.

Change-Id: I8943bb90c9f23c0e58c296ad3b45153d0364953c
Signed-off-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Reviewed-on: https://code.wireshark.org/review/31708
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-23 21:17:14 +00:00
Swapnil Roy e774aa6044 NAS 5Gs: Updated SM cause
Change-Id: Ic09c8206fe5a35b173c16209d0bc5e10caf9c4c9
Reviewed-on: https://code.wireshark.org/review/31700
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-23 20:15:49 +00:00
Peter Wu d4913bd5ba SDP: fix memleak of "trace_id"
The string value is stored in the conversation, so use file-scoped
memory instead of g_strdup. Convert to union to save space.

Bug: 15440
Change-Id: Ie2dabfc67ac1db1cc8f864601b8395dcdec7caf8
Fixes: v2.9.0rc0-2719-g8bd0616621 ("SDP: Show callid from all call legs with the same RTP cpnversation.")
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11845
Reviewed-on: https://code.wireshark.org/review/31704
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-23 20:15:23 +00:00
Peter Wu e8f6a90a85 SMB2: fix memleak of tids hash table
Caught by ASAN:

    Direct leak of 88 byte(s) in 1 object(s) allocated from:
        #0 0x564bccf83549 in malloc (run/tshark+0x1b0549)
        #1 0x7f8dd1d488d1 in g_malloc glib/glib/gmem.c:99:13
        #2 0x7f8dd1d29094 in g_slice_alloc glib/glib/gslice.c:1024:11
        #3 0x7f8dd1d64cde in g_hash_table_new_full glib/glib/ghash.c:717:16
        #4 0x7f8dde889de6 in smb2_get_session epan/dissectors/packet-smb2.c:1135:15
        #5 0x7f8dde89258e in dissect_smb2_session_setup_response epan/dissectors/packet-smb2.c:3356:16
        #6 0x7f8dde8867cd in dissect_smb2_command epan/dissectors/packet-smb2.c:9189:12
        #7 0x7f8dde87fb6e in dissect_smb2 epan/dissectors/packet-smb2.c:9543:27

Change-Id: I33586e8d27263a8e546efb2ee3a3054eb9a66893
Reviewed-on: https://code.wireshark.org/review/31702
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2019-01-23 18:29:21 +00:00
Peter Wu 8ce3450b24 SDP: remove unused setup_proto field to fix memleaks
Bug: 15440
Change-Id: I2a543eef23e1b006928edef353e88b0612c5cdb7
Fixes: v2.9.0rc0-2676-gd68b7bc505 ("Add sip_call_id filter to RTP stream.")
Fixes: v2.9.0rc0-2720-g228da02fda ("RTP: Restructure call id handling.")
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11845
Reviewed-on: https://code.wireshark.org/review/31701
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-23 17:23:36 +00:00
Joerg Mayer ca28f41d7e Small update up LLDP sub-tlvs
Change-Id: I33ed38d4819236e2d6f6b7384650fa182233ce30
Reviewed-on: https://code.wireshark.org/review/31706
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2019-01-23 17:22:44 +00:00
Joerg Mayer 81694c8498 Update BGP capabilities list
Change-Id: I4085b4e3ed4ea587b757e64068995e155eabc543
Reviewed-on: https://code.wireshark.org/review/31705
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2019-01-23 17:20:39 +00:00