metze/wireshark/wip.git
6 years agoMake sure we pass valid addresses to find_conversation.
Gerald Combs [Mon, 5 Feb 2018 22:28:10 +0000 (14:28 -0800)]
Make sure we pass valid addresses to find_conversation.

Pass empty (AT_NONE) addresses to find_conversation and
conversation_create_endpoint instead of NULL, similar to the LBTxx and
other dissectors.

Bug: 14394
Change-Id: Ia4573b276551a9c3d2da155faf786e8d15229100
Reviewed-on: https://code.wireshark.org/review/25620
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
6 years ago[SBC-AP] Enhance info column information.
AndersBroman [Tue, 6 Feb 2018 13:54:01 +0000 (14:54 +0100)]
[SBC-AP] Enhance info column information.

Change-Id: If02d2b1dcda5df8a09b3689b2ba3dc5914db3420
Reviewed-on: https://code.wireshark.org/review/25635
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
6 years agoabout_dialog (qt): Fix Dead Store (Dead assignement/Dead increment) Warning found...
Alexis La Goutte [Sun, 4 Feb 2018 20:49:29 +0000 (21:49 +0100)]
about_dialog (qt): Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang

Change-Id: Ib7c673980909551d9f817d60bbe2d77ed180b661
Reviewed-on: https://code.wireshark.org/review/25599
Reviewed-by: Roland Knall <rknall@gmail.com>
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
6 years ago[Thrift] Handle optional elememts in struct.
AndersBroman [Tue, 6 Feb 2018 13:21:23 +0000 (14:21 +0100)]
[Thrift] Handle optional elememts in struct.

Change-Id: Iee494c299f8f10588146f0b41b759ce0272d9caf
Reviewed-on: https://code.wireshark.org/review/25634
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
6 years ago[Thrift] Add methods for the 64bit types.
AndersBroman [Tue, 6 Feb 2018 09:40:46 +0000 (10:40 +0100)]
[Thrift] Add methods for the 64bit types.

Change-Id: I4a3ca0eb715562c9ed535df471edb62830215369
Reviewed-on: https://code.wireshark.org/review/25630
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
6 years agoUse the Wayback Machine for a reference.
Guy Harris [Tue, 6 Feb 2018 08:32:38 +0000 (00:32 -0800)]
Use the Wayback Machine for a reference.

Change-Id: I4745cdf6ba863674525851e98c8a52422d4e65f0
Reviewed-on: https://code.wireshark.org/review/25628
Reviewed-by: Guy Harris <guy@alum.mit.edu>
6 years agoUse separate dissectors for LAPD and LAPD-with-Linux-SLL-header.
Guy Harris [Tue, 6 Feb 2018 08:15:44 +0000 (00:15 -0800)]
Use separate dissectors for LAPD and LAPD-with-Linux-SLL-header.

That obviates the need to check pinfo->pkt_encap.

Change-Id: I038e065932282ce9d3362fbc9ba6ea653a63f399
Reviewed-on: https://code.wireshark.org/review/25627
Reviewed-by: Guy Harris <guy@alum.mit.edu>
6 years agoBACapp: Fix a loop check.
Gerald Combs [Mon, 5 Feb 2018 23:34:41 +0000 (15:34 -0800)]
BACapp: Fix a loop check.

Fix an offset check in a nested loop. Make our offset checks more
paranoid.

Bug: 14387
Change-Id: I2890b27731ec293a3cb08dcfdf7a18aef808ad31
Reviewed-on: https://code.wireshark.org/review/25622
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
6 years agoIPMI: Add NULL pointer checks.
Gerald Combs [Mon, 5 Feb 2018 23:24:19 +0000 (15:24 -0800)]
IPMI: Add NULL pointer checks.

Check for a valid data->curr_frame in ipmi_set_data and ipmi_get_data.

Bug: 14393
Change-Id: I615975015da864718dbd486d875aa3020db94edd
Reviewed-on: https://code.wireshark.org/review/25621
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
6 years agoProto tree: Update left arrow navigation behavior.
Gerald Combs [Tue, 6 Feb 2018 00:48:13 +0000 (16:48 -0800)]
Proto tree: Update left arrow navigation behavior.

If the user presses the left arrow when a non-expaned proto tree item is
selected, jump to its parent item as described in the "Main Window
Navigation" section of the User's Guide..

Change-Id: Ie7478a2c292df9a225555f5539d7ba90ab5e132d
Reviewed-on: https://code.wireshark.org/review/25623
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
6 years agoThrift: stop dissection when encountering an unknown/unexpected type
Pascal Quantin [Mon, 5 Feb 2018 21:35:10 +0000 (22:35 +0100)]
Thrift: stop dissection when encountering an unknown/unexpected type

Let's add an expert info, and set offset to the end of the current tvb.

Bug: 14379
Change-Id: Iaccf862c451eef58aaed11b26fceebf26bc2c818
Reviewed-on: https://code.wireshark.org/review/25619
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
6 years agoDon't assume all packets have time stamps.
Guy Harris [Tue, 6 Feb 2018 04:24:33 +0000 (20:24 -0800)]
Don't assume all packets have time stamps.

We explicitly allow the not to, and, for example, Simple Packet Blocks
in pcapng files don't have time stamps.

Change-Id: I6c8921cf092de7831d0a3d6dab8467388f4e6286
Reviewed-on: https://code.wireshark.org/review/25625
Reviewed-by: Guy Harris <guy@alum.mit.edu>
6 years agoWSUG: Minor edits.
Gerald Combs [Tue, 6 Feb 2018 00:57:28 +0000 (16:57 -0800)]
WSUG: Minor edits.

Use "or" instead of a comma for alternate keyboard shortcuts.

Change-Id: I3f2abf63b4c437ca0fe439d91dfac44e24d9d8e5
Reviewed-on: https://code.wireshark.org/review/25624
Reviewed-by: Gerald Combs <gerald@wireshark.org>
6 years agoDon't assume records all have time stamps and captured lengths.
Guy Harris [Mon, 5 Feb 2018 21:26:40 +0000 (13:26 -0800)]
Don't assume records all have time stamps and captured lengths.

Not all do, so test the preference bits for them.

Change-Id: I62976f5d17de3611c4d2f9eb64a0763c0b698c8d
Reviewed-on: https://code.wireshark.org/review/25618
Reviewed-by: Guy Harris <guy@alum.mit.edu>
6 years agoSpeak of records, not packets.
Guy Harris [Mon, 5 Feb 2018 20:55:00 +0000 (12:55 -0800)]
Speak of records, not packets.

Not everything wtap_read() returns is a packet.

Change-Id: I3784bbfa308da52f4c55db2a90f9b55f8bfbb2ef
Reviewed-on: https://code.wireshark.org/review/25617
Reviewed-by: Guy Harris <guy@alum.mit.edu>
6 years agopacket-mq: Fix a wrong offset+Add value in val_str
Robert Grange [Sun, 4 Feb 2018 23:09:47 +0000 (00:09 +0100)]
packet-mq: Fix a wrong offset+Add value in val_str

fixed an offset error for mqmo in gmo
Added value in comment when defining val_str

Change-Id: Ie29f65f96d2ffb96c0cc0623346432f1f8380168
Reviewed-on: https://code.wireshark.org/review/25604
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
6 years agoUpdate couchbase dissector with collections and delete_time DCP
Jim Walker [Mon, 5 Feb 2018 09:30:43 +0000 (09:30 +0000)]
Update couchbase dissector with collections and delete_time DCP

Add support for collection commands
* SET/GET manifest
* DCP changes (mutation/deletion/system_event)

Add support for DCP delete_time, a new format for DCP deletion

Change-Id: Iec2000a40da37dcb1edf665a157dc7ab30d4c9d0
Reviewed-on: https://code.wireshark.org/review/25612
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
6 years agoAmend the comment with some background for the workaround.
Jaap Keuter [Mon, 5 Feb 2018 15:53:23 +0000 (16:53 +0100)]
Amend the comment with some background for the workaround.

The added comment only explains what the cause of the problem is,
and the subsequent workaround, without going into how this could be
properly addressed. Add some lines to add that information.

Change-Id: I74e4df0e0c4b41fe8d52d9abf2d15335d2b327d6
Reviewed-on: https://code.wireshark.org/review/25614
Reviewed-by: Guy Harris <guy@alum.mit.edu>
6 years agoAsciiDoc: Convert some comments.
Gerald Combs [Mon, 5 Feb 2018 16:59:45 +0000 (08:59 -0800)]
AsciiDoc: Convert some comments.

Convert some passthrough XML comments left over from the DocBook →
AsciiDoc conversion to AsciiDoc / Asciidoctor comments.

Change-Id: Iaf44bcf0b8a3a383e735b2b4394722cbbb2bdff3
Reviewed-on: https://code.wireshark.org/review/25615
Reviewed-by: Gerald Combs <gerald@wireshark.org>
6 years agoUpdate couchbase dissector with new HELLO feature values
Jim Walker [Mon, 5 Feb 2018 09:34:13 +0000 (09:34 +0000)]
Update couchbase dissector with new HELLO feature values

Simply add missing feature values to the existing table

Change-Id: Ie4b0876df1d736af1cd1171a6645df75e2eb8cf2
Reviewed-on: https://code.wireshark.org/review/25611
Reviewed-by: Dave Rigby <daver@couchbase.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
6 years agoQt: Update recent status via a non-blocking connection.
Gerald Combs [Sat, 3 Feb 2018 17:51:14 +0000 (09:51 -0800)]
Qt: Update recent status via a non-blocking connection.

Connect our recent file status signal using a Qt::QueuedConnection
instead of a Qt::BlockingQueuedConnection. As described at
https://woboq.com/blog/how-qt-signals-slots-work-part3-queuedconnection.html,
QueuedConnection makes a copy of the argument list while
BlockingQueuedConnection passess the list directly.

This fixes what appears to be a false positive reported by
ThreadSanitizer. Cross-thread signals are protected by a QMutex, but
qmutex_mac.cpp in the Qt5 sources uses a Mach semaphore. The
ThreadSanitizer manual says it supports pthread mutexes and compiler
atomic operations but doesn't mention Mach semaphores.

Change-Id: Icb8a63d7d0bdfe985ab8274757043ef45ae4bcde
Reviewed-on: https://code.wireshark.org/review/25576
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
6 years agoDelete an out-of-date comment.
Guy Harris [Mon, 5 Feb 2018 05:07:12 +0000 (21:07 -0800)]
Delete an out-of-date comment.

Change-Id: Idc86f8fbb401fd0da39ef3b5e7aff04173006b22
Reviewed-on: https://code.wireshark.org/review/25610
Reviewed-by: Guy Harris <guy@alum.mit.edu>
6 years agoHave block read routines indicate whether the block should be returned.
Guy Harris [Mon, 5 Feb 2018 04:33:02 +0000 (20:33 -0800)]
Have block read routines indicate whether the block should be returned.

Some blocks should be returned by wtap_read(), others are just processed
internally.  Add a Boolean flag to wtapng_block_t, have the routines
that read particular block types set it appropriately, and have the read
and seek-read routines check that flag rather than checking for the
block types that should be returned.  Pass a pointer to the
wtapng_block_t to packet type plugin read routines, rather than passing
it some members of the wtapng_block_t.

This means that 1) for new block types, we don't have to update any
tests and 2) plugin handlers for block types can indicate whether they
processed the block internally and the caller shouldn't see it or 2) the
block should be provided to the caller.

Bug: 14388
Change-Id: Iccc2031a277f55c7fa8b4f692c776b482b792b4f
Reviewed-on: https://code.wireshark.org/review/25609
Reviewed-by: Guy Harris <guy@alum.mit.edu>
6 years agopcapng_read_block() should just return a Boolean.
Guy Harris [Mon, 5 Feb 2018 03:28:41 +0000 (19:28 -0800)]
pcapng_read_block() should just return a Boolean.

It either returns "OK" or "fail", so we might as well make it a Boolean.

While we're at it, in pcapng_open(), handle EOF/short read and "invalid
file" errors when trying to read the first block differently; for the
first of those, we don't need to free *err_info, and this may be a bit
safer in case *err_info didn't happen to be set to NULL somewhere along
the line.

Change-Id: If8135624e3efb7838dceeb28e30e5c8c4b064786
Reviewed-on: https://code.wireshark.org/review/25608
Reviewed-by: Guy Harris <guy@alum.mit.edu>
6 years agopcapng_read_section_header_block() should just return a Boolean.
Guy Harris [Mon, 5 Feb 2018 03:13:06 +0000 (19:13 -0800)]
pcapng_read_section_header_block() should just return a Boolean.

It either returns "OK" or "fail", so we might as well make it a Boolean,
just as is the case with read routines for other block types.

Update some comments while we're at it.

Change-Id: I40b378d4e3c3cfb96687298b22a6f8f9f78d9240
Reviewed-on: https://code.wireshark.org/review/25607
Reviewed-by: Guy Harris <guy@alum.mit.edu>
6 years agoMore AsciiDoc → Asciidoctor updates.
Gerald Combs [Sun, 4 Feb 2018 23:15:02 +0000 (15:15 -0800)]
More AsciiDoc → Asciidoctor updates.

Switch from AsciiDoc's smart quotes markup to the quotes themselves. Use
double curly quotes in place of singles.

Switch from XML entities to their direct equivalents where we can.
Switch from hex entities to decimal entities where we can't or it's not
convenient. (Asciidoctor PDF doesn't yet handle hex entities).

Change-Id: Iaf5ec33249e1c91b3d50b5d96251763243b72836
Reviewed-on: https://code.wireshark.org/review/25606
Reviewed-by: Gerald Combs <gerald@wireshark.org>
6 years agovalid_but_empty_file is a Boolean, so declare it as such.
Guy Harris [Sun, 4 Feb 2018 23:18:23 +0000 (15:18 -0800)]
valid_but_empty_file is a Boolean, so declare it as such.

If it's either going to be -1 or 1, and any value > 0 is "valid but
empty", that's just a Boolean, with -1 corresponding to false and 1
corresponding to true.  Make it so.

Change-Id: Ib7418fe7573b5d2cd1e2ef5de601c0262c8d9de1
Reviewed-on: https://code.wireshark.org/review/25605
Reviewed-by: Guy Harris <guy@alum.mit.edu>
6 years agoCheck for read errors by checking for PCAPNG_BLOCK_ERROR.
Guy Harris [Sun, 4 Feb 2018 23:00:55 +0000 (15:00 -0800)]
Check for read errors by checking for PCAPNG_BLOCK_ERROR.

Check for "is an error" rather than "isn't OK".

Change-Id: Ib8f4ac44f70d71ff44658801e01807344032dd60
Reviewed-on: https://code.wireshark.org/review/25603
Reviewed-by: Guy Harris <guy@alum.mit.edu>
6 years agoDon't treat short reads as errors when checking the file type.
Guy Harris [Sun, 4 Feb 2018 22:53:58 +0000 (14:53 -0800)]
Don't treat short reads as errors when checking the file type.

A short read isn't a clear error when you don't have a magic number and
are doing "does this look somewhat like a file of this type" test, it's
probably an indication that it's *not* a file of that type.

Change-Id: Iab2f32e7d169a777c50a36958eeb4e82a3809227
Reviewed-on: https://code.wireshark.org/review/25602
Reviewed-by: Guy Harris <guy@alum.mit.edu>
6 years agoDocs: Make our AsciiDoc markup more compatible with AsciiDoctor.
Gerald Combs [Sun, 4 Feb 2018 19:39:56 +0000 (11:39 -0800)]
Docs: Make our AsciiDoc markup more compatible with AsciiDoctor.

Start using markup that is preferred by Asciidoctor but compatible with
both generators.

Add a missing "cpp" attribute and set a couple of Asciidoctor-specific
compatibility attributes.

Change-Id: Iff4c31362e4493b97a85f46db2c39b18c336536f
Reviewed-on: https://code.wireshark.org/review/25600
Reviewed-by: Gerald Combs <gerald@wireshark.org>
6 years agoDon't put knowledge about the "is this pcapng" test in the block-reading code.
Guy Harris [Sun, 4 Feb 2018 22:16:37 +0000 (14:16 -0800)]
Don't put knowledge about the "is this pcapng" test in the block-reading code.

Have pcapng_read_section_header_block(),
pcapng_read_section_header_block(), and pcapng_read_block() just return
errors when they get errors or get a non-SHB block; let pcap_open() turn
EOF, short read, and "bad file" into "not a pcapng file" rather than
"read error".

Change-Id: If018d21ffe3de3fe7eb1f8f2973f80f685c89274
Reviewed-on: https://code.wireshark.org/review/25601
Reviewed-by: Guy Harris <guy@alum.mit.edu>
6 years agoMQ: use real string length when calling strip_trailing_blanks()
Pascal Quantin [Sun, 4 Feb 2018 16:31:23 +0000 (17:31 +0100)]
MQ: use real string length when calling strip_trailing_blanks()

Bug: 14390
Change-Id: I5acfc651237da55c3ee907f21d89a3add6edeeef
Reviewed-on: https://code.wireshark.org/review/25596
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
6 years agoMQ: keep extended value string array sorted
Pascal Quantin [Sun, 4 Feb 2018 15:47:21 +0000 (16:47 +0100)]
MQ: keep extended value string array sorted

Change-Id: If7d6c8d75179eca213a90977657c61e9a9677474
Reviewed-on: https://code.wireshark.org/review/25595
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
6 years agoDon't install test programs (fuzzshark and dftest)
João Valverde [Sun, 4 Feb 2018 10:22:58 +0000 (10:22 +0000)]
Don't install test programs (fuzzshark and dftest)

These binaries are not intended for end-users.

Change-Id: I1e1ecd7424bbbe1b2935390e2daf7e3f1089ee28
Reviewed-on: https://code.wireshark.org/review/25594
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot
Reviewed-by: João Valverde <j@v6e.pt>
6 years agopacket-mq: Fix problem in get_mq_pdu_len
Robert Grange [Sat, 3 Feb 2018 11:09:11 +0000 (12:09 +0100)]
packet-mq: Fix problem in get_mq_pdu_len

Found during fuzz test that the get_mq_pdu_len can return
a 0 length pdu. Fix to at least return tvb_reported_length_remaining

Change-Id: I6410f71724a6288fe42a4f600e72a8af787aa7eb
Reviewed-on: https://code.wireshark.org/review/25574
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
6 years ago[Automatic update for 2018-02-04]
Gerald Combs [Sun, 4 Feb 2018 08:14:31 +0000 (08:14 +0000)]
[Automatic update for 2018-02-04]

Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I66df4a62ae7fb7c986130fec01359ebb7b00d71f
Reviewed-on: https://code.wireshark.org/review/25590
Reviewed-by: Gerald Combs <gerald@wireshark.org>
6 years agoDon't assume address data is aligned.
Guy Harris [Sun, 4 Feb 2018 04:10:19 +0000 (20:10 -0800)]
Don't assume address data is aligned.

The data for an address is *not* guaranteed to be aligned on any
particular boundary, so, for IPv4 addresses, don't assume it's aligned
on a 32-bit boundary - to get it in host byte order, fetch it with
pntoh32(), which fetches a 32-bit value that's in network byte order,
and isn't necessarily aligned on any particular boundary, and returns it
in host byte order.

Change-Id: Ic512ab4b1e0f2815d9f0af0e33714f456a08a45d
Reviewed-on: https://code.wireshark.org/review/25589
Reviewed-by: Guy Harris <guy@alum.mit.edu>
6 years agoNote that we should show ISBs in the "packet" list.
Guy Harris [Sun, 4 Feb 2018 02:31:10 +0000 (18:31 -0800)]
Note that we should show ISBs in the "packet" list.

Change-Id: Id39712f9926f05528e4e6120d0feba7c319b3bb2
Reviewed-on: https://code.wireshark.org/review/25588
Reviewed-by: Guy Harris <guy@alum.mit.edu>
6 years agoGive an IDB and an NRB as examples of the third type of block.
Guy Harris [Sun, 4 Feb 2018 02:23:42 +0000 (18:23 -0800)]
Give an IDB and an NRB as examples of the third type of block.

There are events, there are reports, and there are "here's metadata that
doesn't correspond to something that happened at this point in the
capture"; IDBs and NRBs are the third type.

Change-Id: I89e4f9bf51dc1be5766e8df61c6337ed3e484577
Reviewed-on: https://code.wireshark.org/review/25587
Reviewed-by: Guy Harris <guy@alum.mit.edu>
6 years agoHave individual plugin CMakeLists.txt files add library dependencies.
Guy Harris [Sun, 4 Feb 2018 01:22:09 +0000 (17:22 -0800)]
Have individual plugin CMakeLists.txt files add library dependencies.

This removes any knowledge of plugin types from
cmake/modules/WiresharkPlugin.cmake, so that it doesn't have to be
changed if we add a new plugin type.  Revert to the second argument to
add_plugin_library() and install_plugin() being the subfolder.

Change-Id: I668ab90b28c73a8b12ca8e3e906b8de2f9395ca5
Reviewed-on: https://code.wireshark.org/review/25585
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
6 years agoNew symbols.
Guy Harris [Sun, 4 Feb 2018 01:45:43 +0000 (17:45 -0800)]
New symbols.

Change-Id: I3ddb5d89a0b1e1afc5979b2e028030ff61f1ee05
Reviewed-on: https://code.wireshark.org/review/25586
Reviewed-by: Guy Harris <guy@alum.mit.edu>
6 years agoProcess all subdirectories of $pkgplugin as directories of plugins.
Guy Harris [Sun, 4 Feb 2018 00:58:24 +0000 (16:58 -0800)]
Process all subdirectories of $pkgplugin as directories of plugins.

That way we don't have to change the script if we add new plugin
subdirectories.

Change-Id: Ic788807c723306e461b7c1f8721b48a46d4fff96
Reviewed-on: https://code.wireshark.org/review/25584
Reviewed-by: Guy Harris <guy@alum.mit.edu>
6 years agoDisallow registration of some block type values for plugins.
Guy Harris [Sun, 4 Feb 2018 00:41:13 +0000 (16:41 -0800)]
Disallow registration of some block type values for plugins.

Don't allow overriding of the block types we support in libwiretap - it
won't work anyway, as we check for those types first, and only look for
plugins for types we don't support.

Don't allow registering for any of the reserved types; if you aren't
going to use a local type, you have to get your type registered.

We *do* allow registering plugins for types that are registered but that
we don't support natively.

Change-Id: I2046d297b0503d3a77c83166b07ca226c0b18e82
Reviewed-on: https://code.wireshark.org/review/25583
Reviewed-by: Guy Harris <guy@alum.mit.edu>
6 years agomqtt: Put msgid and topic in Info column
Stig Bjørlykke [Sat, 3 Feb 2018 20:04:47 +0000 (21:04 +0100)]
mqtt: Put msgid and topic in Info column

Change-Id: If6e149f21a9c8bd122daa6d751f72b8d8c0454ff
Reviewed-on: https://code.wireshark.org/review/25578
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
6 years agoAdd a comment explaining why err is volatile.
Guy Harris [Sat, 3 Feb 2018 21:32:50 +0000 (13:32 -0800)]
Add a comment explaining why err is volatile.

And also indicate that perhaps the right solution was just to close the
CID as a false positive, as Coverity doesn't have a deep enough
understanding of libnl to know that the loop isn't guaranteed to be
infinite.

Change-Id: Ieb0651c803a5939fb54f2bc68bdf8c5485dafaf2
Reviewed-on: https://code.wireshark.org/review/25582
Reviewed-by: Guy Harris <guy@alum.mit.edu>
6 years agoClean up addition of FT_IPv{4,6} fields.
Guy Harris [Sat, 3 Feb 2018 21:15:30 +0000 (13:15 -0800)]
Clean up addition of FT_IPv{4,6} fields.

The data for an address is *not* guaranteed to be aligned on any
particular boundary, so, for IPv4 addresses, don't assume it's aligned
on a 32-bit boundary - copy it with memcpy() and use the result of the
copy.

For IPv6 addresses, cast the data pointer to a pointer to a *const*
ws_in6_addr, so we don't throw away constness.

Change-Id: I0e00263f594d7778c3bd9b98e4336cb201c1f3d5
Reviewed-on: https://code.wireshark.org/review/25580
Reviewed-by: Guy Harris <guy@alum.mit.edu>
6 years agoDon't link wiretap plugins with libwireshark.
Guy Harris [Sat, 3 Feb 2018 20:25:24 +0000 (12:25 -0800)]
Don't link wiretap plugins with libwireshark.

Make the second argument to add_plugin_library() and install_plugin() be
a plugin type - currently, either "epan" or "wiretap" - and, based on
its value, set the subfolder and required libraries in
add_plugin_library() and the subfolder in install_plugin().  If it's not
one of the known values, fail.

Change-Id: I556863772c59330d2854fbb4673f544f8359dcd2
Reviewed-on: https://code.wireshark.org/review/25579
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
6 years agoHandle separate directories for libwireshark and libwiretap plugins.
Guy Harris [Sat, 3 Feb 2018 18:38:58 +0000 (10:38 -0800)]
Handle separate directories for libwireshark and libwiretap plugins.

We now have "epan" and "wiretap" subdirectories of the plugin directory,
with the first containing libwireshark plugins and the second containing
libwiretap plugins.  Look for plugins in those directories, rather than
in the top-level plugin directory.

Bug: 14389
Change-Id: Ia3bd4d27e82215207e7a7dcfc8f91042bbc61737
Reviewed-on: https://code.wireshark.org/review/25577
Reviewed-by: Guy Harris <guy@alum.mit.edu>
6 years agodmp: fix memleaks
Jakub Zawadzki [Sat, 3 Feb 2018 12:31:58 +0000 (13:31 +0100)]
dmp: fix memleaks

dmp_long_id_hash_table is wmem_map autoreset on file scope.
Don't put there g_strdup() data.

Valgrind log:
==15134== 8 bytes in 2 blocks are definitely lost in loss record 3,988 of 49,961
==15134==    at 0x4C29C4F: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==15134==    by 0xA94E405: g_malloc (gmem.c:97)
==15134==    by 0xA966C4E: g_strdup (gstrfuncs.c:356)
==15134==    by 0x6CFC301: dissect_mts_identifier (packet-dmp.c:2684)
==15134==    by 0x6D01A8F: dissect_dmp_envelope (packet-dmp.c:2935)
==15134==    by 0x6D01A8F: dissect_dmp (packet-dmp.c:3909)

Found by oss-fuzz.

Change-Id: I7c3896a9b64c25035fbe8b4ef6130cd693a515db
Reviewed-on: https://code.wireshark.org/review/25575
Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
6 years agoCIP Motion: Support Format Revision 3
Dylan Ulis [Fri, 2 Feb 2018 16:47:44 +0000 (11:47 -0500)]
CIP Motion: Support Format Revision 3

See Volume 9, version 1.2, sections "6-2.7.1.1" and "7-1.1"
1. Pass Connection Point from FwdOpen to Motion dissector, since that is now needed to parse I/O payload.
2. Move Run/Idle Header function to CIP dissector, since it's a CIP feature, not ENIP.
3. Add a protocol so that Format Revision 3 can be dissected without the Forward Open in the capture.
4. Minor: Highlight more bytes in some EPATH parsing.
5. Minor: Renaming some things to match spec wording.

Change-Id: I93626a6492be2675206d38c04fa1c7ce534c04ca
Reviewed-on: https://code.wireshark.org/review/25570
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
6 years agoMake a deep copy of our filename in RecentFileStatus.
Gerald Combs [Fri, 2 Feb 2018 17:37:50 +0000 (09:37 -0800)]
Make a deep copy of our filename in RecentFileStatus.

QStrings are implictly shared as described at
http://doc.qt.io/qt-5/implicit-sharing.html. This is normally useful,
but RecentFileStatus is passed a QString before it does its work in a
separate thread.

Make a deep copy of the filename in order to ensure local ownership and
to avoid having to fool around with a QMutex (which might not be
recognized by ThreadSanitizer[1] or Helgrind[2]).

Remove getFilename since it was unused.

[1] https://github.com/google/sanitizers/issues/460
[2] http://valgrind.org/docs/manual/hg-manual.html

Change-Id: I5b5c329505ed8c02d30043a2a6d1ded625924b9f
Reviewed-on: https://code.wireshark.org/review/25572
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
6 years agoquic: fix secret memleaks.
Jakub Zawadzki [Fri, 2 Feb 2018 17:35:38 +0000 (18:35 +0100)]
quic: fix secret memleaks.

It looks like that quic_create_cleartext_decoders() need to free secrets, tls13_cipher_create() only use it as const.

ASAN report:
ERROR: LeakSanitizer: detected memory leaks

Direct leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0x4e26e8 in __interceptor_malloc /src/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:88
    #1 0x225b038 in g_malloc
    #2 0x1742014 in quic_derive_cleartext_secrets /src/wireshark/epan/dissectors/packet-quic.c:1071:10
    #3 0x173e579 in quic_create_cleartext_decoders /src/wireshark/epan/dissectors/packet-quic.c:1091:10
    #4 0x173dc89 in dissect_quic_long_header /src/wireshark/epan/dissectors/packet-quic.c:1221:14
    #5 0x173ced6 in dissect_quic /src/wireshark/epan/dissectors/packet-quic.c:1402:18
(...)

Direct leak of 32 byte(s) in 1 object(s) allocated from:
    #0 0x4e26e8 in __interceptor_malloc /src/llvm/projects/compiler-rt/lib/asan/asan_malloc_linux.cc:88
    #1 0x225b038 in g_malloc
    #2 0x1741fd5 in quic_derive_cleartext_secrets /src/wireshark/epan/dissectors/packet-quic.c:1065:10
    #3 0x173e579 in quic_create_cleartext_decoders /src/wireshark/epan/dissectors/packet-quic.c:1091:10
    #4 0x173dc89 in dissect_quic_long_header /src/wireshark/epan/dissectors/packet-quic.c:1221:14
    #5 0x173ced6 in dissect_quic /src/wireshark/epan/dissectors/packet-quic.c:1402:18
(...)

Found by oss-fuzz/5902.

Change-Id: I6f8a4597411ee267773225e45043addb69928d66
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5902
Reviewed-on: https://code.wireshark.org/review/25571
Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
6 years agoepl: fix map.title memleak.
Jakub Zawadzki [Fri, 2 Feb 2018 19:44:39 +0000 (20:44 +0100)]
epl: fix map.title memleak.

Valgrind report:
==642== 14 bytes in 1 blocks are definitely lost in loss record 5,705 of 49,814
==642==    by 0xA966DCC: g_strdup_vprintf (gstrfuncs.c:507)
==642==    by 0xA966E88: g_strdup_printf (gstrfuncs.c:533)
==642==    by 0x6D523F4: dissect_object_mapping (packet-epl.c:4216)
==642==    by 0x6D56394: dissect_epl_sdo_command (packet-epl.c:3862)
==642==    by 0x6D56394: dissect_epl_asnd_sdo (packet-epl.c:3572)
==642==    by 0x6D59BC5: dissect_epl_asnd (packet-epl.c:3053)
==642==    by 0x6D59BC5: dissect_eplpdu.part.21 (packet-epl.c:2627)

Found by oss-fuzz/5907.

Change-Id: I6f4d2cea761581260af396c848ab1fded5641b44
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5907
Reviewed-on: https://code.wireshark.org/review/25573
Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
6 years agoQt: Keep auto-scroll when starting a new capture
Stig Bjørlykke [Fri, 2 Feb 2018 14:59:04 +0000 (15:59 +0100)]
Qt: Keep auto-scroll when starting a new capture

Avoid turning off actionGoAutoScroll when going to the first packet
when starting a new capture.

Bug: 14257
Change-Id: I676139696cf4917b779c5fd390d7a22fb373a6b5
Reviewed-on: https://code.wireshark.org/review/25568
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
6 years agoIncrease PROTO_PRE_ALLOC_HF_FIELDS_MEM
Graham Bloice [Fri, 2 Feb 2018 12:30:19 +0000 (12:30 +0000)]
Increase PROTO_PRE_ALLOC_HF_FIELDS_MEM

    We've added more fields, increment the pre-allocation amount.

Change-Id: Ia5f1aab7a2fa120049162d17a63f99bf21a3fe37
Reviewed-on: https://code.wireshark.org/review/25566
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
6 years agoQt: Avoid divide-by-zero if missing AUTHORS file
Stig Bjørlykke [Fri, 2 Feb 2018 12:58:44 +0000 (13:58 +0100)]
Qt: Avoid divide-by-zero if missing AUTHORS file

When debugging with at least Xcode the AUTHORS file is missing,
so ensure we don't divide by zero when this happens.

Change-Id: Idd7cdf8137998c872f80108662fbb8a133110af2
Reviewed-on: https://code.wireshark.org/review/25567
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
6 years agocli: use SPDX identifiers.
Dario Lombardo [Fri, 2 Feb 2018 11:00:51 +0000 (12:00 +0100)]
cli: use SPDX identifiers.

Change-Id: I7ce9b2a32f4ddad93ca1d9697c2a76b067f9e5f7
Reviewed-on: https://code.wireshark.org/review/25564
Reviewed-by: Michael Mann <mmann78@netscape.net>
6 years agocapchild: use SPDX identifiers.
Dario Lombardo [Fri, 2 Feb 2018 10:45:42 +0000 (11:45 +0100)]
capchild: use SPDX identifiers.

Change-Id: I123e043c3266993081f9bff404da5d7db76ee68e
Reviewed-on: https://code.wireshark.org/review/25558
Reviewed-by: Michael Mann <mmann78@netscape.net>
6 years agoQt: use SPDX identifiers.
Dario Lombardo [Fri, 2 Feb 2018 10:57:21 +0000 (11:57 +0100)]
Qt: use SPDX identifiers.

Change-Id: I111945c08f99818c249a868c12d9a7b3a3df64b3
Reviewed-on: https://code.wireshark.org/review/25563
Reviewed-by: Michael Mann <mmann78@netscape.net>
6 years agoui: use SPDX identifiers.
Dario Lombardo [Fri, 2 Feb 2018 11:06:07 +0000 (12:06 +0100)]
ui: use SPDX identifiers.

Change-Id: I6b05399395bcc35e59b73b4030ba4a05711a7b1a
Reviewed-on: https://code.wireshark.org/review/25565
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
6 years agofuzzshark: use SPDX identifier.
Dario Lombardo [Fri, 2 Feb 2018 10:54:24 +0000 (11:54 +0100)]
fuzzshark: use SPDX identifier.

Change-Id: I9c786b8bbb96a4bfa1560536c3929b844aa8afb7
Reviewed-on: https://code.wireshark.org/review/25562
Reviewed-by: Michael Mann <mmann78@netscape.net>
6 years agorandpkt_core: use SPDX identifiers.
Dario Lombardo [Fri, 2 Feb 2018 10:53:50 +0000 (11:53 +0100)]
randpkt_core: use SPDX identifiers.

Change-Id: I3b8bb17c0c679533cc5281aaf18881e859fe7cf6
Reviewed-on: https://code.wireshark.org/review/25561
Reviewed-by: Michael Mann <mmann78@netscape.net>
6 years agocodex: use SPDX identifiers.
Dario Lombardo [Fri, 2 Feb 2018 10:52:41 +0000 (11:52 +0100)]
codex: use SPDX identifiers.

Change-Id: I02f43e660484e9c0ebce96b42dbdd7b4229a1198
Reviewed-on: https://code.wireshark.org/review/25560
Reviewed-by: Michael Mann <mmann78@netscape.net>
6 years agoQt: Add a missing HAVE_LUA guard
Stig Bjørlykke [Fri, 2 Feb 2018 08:40:43 +0000 (09:40 +0100)]
Qt: Add a missing HAVE_LUA guard

Change-Id: I0ee67e769c2c9030da1844a6631dac9a494d0f06
Reviewed-on: https://code.wireshark.org/review/25556
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
6 years agoQt: add initializers in PacketDialog() (CID: 1427679).
Dario Lombardo [Mon, 22 Jan 2018 08:42:09 +0000 (09:42 +0100)]
Qt: add initializers in PacketDialog() (CID: 1427679).

Change-Id: Id2f16d849b85275308101f49a5ea22fbddf66f3b
Reviewed-on: https://code.wireshark.org/review/25411
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
6 years agopacket-mq: Add support for IMS+TM Struct
Dario Lombardo [Tue, 16 Jan 2018 13:40:06 +0000 (14:40 +0100)]
packet-mq: Add support for IMS+TM Struct

Added support for IMS, TM, TMC2 Struct
Improve display some Flags in ID Struct
Fix display for FCNO Struct
Fix error in get_mq_pdu_len
Code reformat (VS2017)
Moved DEFINE to header file
More struct display fixed
Fix for IMS Msg len display

Change-Id: I80bfd25a5079598fc44124dc2c7b850640a38b00
Reviewed-on: https://code.wireshark.org/review/25295
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
6 years agoQt: Fix splash screen "Registering dissectors" message
Stig Bjørlykke [Thu, 1 Feb 2018 14:06:23 +0000 (15:06 +0100)]
Qt: Fix splash screen "Registering dissectors" message

Adjust splash screen message used for registering dissectors when
finished fast from "Registering dissectors Registration finished"
to "Registering dissectors finished".

Change-Id: Id81cf08bb02bea0baa3ac0575b487e271641e27d
Reviewed-on: https://code.wireshark.org/review/25546
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
6 years agoSoupBinTCP: Remove try_conversation_dissector call
Michael Mann [Fri, 2 Feb 2018 00:51:36 +0000 (19:51 -0500)]
SoupBinTCP: Remove try_conversation_dissector call

As stated in the #if 0ed out comments, It's not valid for a
soupbintcp subdissector to call conversation_set_dissector(), so
it shouldn't call try_conversation_dissector.  Just remove the
call entirely so it doesn't look like the removal is temporary.

Change-Id: I68d9b72360b52002692c369d7b202a8a215c0a96
Reviewed-on: https://code.wireshark.org/review/25555
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
6 years agoQt: Always update splash screen on action change
Stig Bjørlykke [Thu, 1 Feb 2018 19:38:04 +0000 (20:38 +0100)]
Qt: Always update splash screen on action change

On a "fast" computer this is needed to find any action which is
taking long time during startup. Without this the splash screen
may show a random action message happening before the slow action.

Also optimize splashUpdate() when nothing to update.

Change-Id: I0946353dbcf12e78323361f2cb4410c6c5605d76
Reviewed-on: https://code.wireshark.org/review/25552
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
6 years agoNote that /guard:cf requires CMake 3.9 or newer.
Gerald Combs [Thu, 1 Feb 2018 23:16:10 +0000 (15:16 -0800)]
Note that /guard:cf requires CMake 3.9 or newer.

Change-Id: I775daafdba012deb2eac5cf8d895be55243d9440
Reviewed-on: https://code.wireshark.org/review/25554
Reviewed-by: Gerald Combs <gerald@wireshark.org>
6 years agoFix memleak in color_filters_read_globals()
Jakub Zawadzki [Thu, 1 Feb 2018 22:48:29 +0000 (23:48 +0100)]
Fix memleak in color_filters_read_globals()

Valgrind log:

==6102== Thread 1:
==6102== 32 bytes in 1 blocks are definitely lost in loss record 24,851 of 49,782
==6102==    at 0x4C29C4F: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==6102==    by 0xB17B7F7: __vasprintf_chk (vasprintf_chk.c:80)
==6102==    by 0xA98C2AB: vasprintf (stdio2.h:210)
==6102==    by 0xA98C2AB: g_vasprintf (gprintf.c:316)
==6102==    by 0xA966DCC: g_strdup_vprintf (gstrfuncs.c:507)
==6102==    by 0xA966E88: g_strdup_printf (gstrfuncs.c:533)
==6102==    by 0x6A66B8C: color_filters_read_globals (color_filters.c:704)
==6102==    by 0x6A66FBE: color_filters_get (color_filters.c:317)
==6102==    by 0x402313: fuzz_init (fuzzshark.c:237)
==6102==    by 0x40252D: LLVMFuzzerInitialize (fuzzshark.c:322)
==6102==    by 0x401E33: main (StandaloneFuzzTargetMain.c:125)

Change-Id: Ibc18edff6097eca736328810c903a151ddee22bc
Reviewed-on: https://code.wireshark.org/review/25553
Tested-by: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jakub Zawadzki <darkjames-ws@darkjames.pl>
6 years agoRTP: ensure that bta2dp_info and btvdp_info are always initialized
Pascal Quantin [Thu, 1 Feb 2018 16:31:23 +0000 (17:31 +0100)]
RTP: ensure that bta2dp_info and btvdp_info are always initialized

Bug: 14380
Change-Id: Ib691b067f25d7281be2f6b4387552252d16d0064
Reviewed-on: https://code.wireshark.org/review/25550
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
6 years agoFix endianness of CAN-ETH CAN packet
Lazar Sumar [Thu, 1 Feb 2018 16:17:04 +0000 (16:17 +0000)]
Fix endianness of CAN-ETH CAN packet

The CAN-ETH protocol explicitly states that the CAN identifiers are
transmitted in little-endian order, and the dissector now decodes it as
little-endian rather than host-endian.

Change-Id: I92c44b809caace31726e0d355363355eb32efa3e
Reviewed-on: https://code.wireshark.org/review/25549
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
6 years agoQt: Show Lua scripts as links in the about box.
Gerald Combs [Wed, 31 Jan 2018 20:03:49 +0000 (12:03 -0800)]
Qt: Show Lua scripts as links in the about box.

Add UrlLinkDelegate::setColCheck, which lets you render strings as URLs
or plain text according to a regex. Use it to show Lua scripts as URLs
in the about box.

Open links on double clicks and add column checks.

Change-Id: Iaf5cd8a46a0b66a7d45079ba045ed2bbcb0ed005
Reviewed-on: https://code.wireshark.org/review/25542
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
6 years agooss-fuzzshark: try to fix oss-fuzz assert fails.
Jakub Zawadzki [Thu, 1 Feb 2018 17:32:31 +0000 (18:32 +0100)]
oss-fuzzshark: try to fix oss-fuzz assert fails.

Change-Id: Ic4ff70dfc55b2694f761cdadcac1962242fca753
Reviewed-on: https://code.wireshark.org/review/25551
Reviewed-by: Jakub Zawadzki <darkjames-ws@darkjames.pl>
6 years agobase64: Adjust whitespace for readability
Stig Bjørlykke [Thu, 1 Feb 2018 14:09:22 +0000 (15:09 +0100)]
base64: Adjust whitespace for readability

Change-Id: Ibf72dddceac925521a0fec3ab0bed7ed360e7c06
Reviewed-on: https://code.wireshark.org/review/25547
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
6 years agojson: Adjust whitespace
Stig Bjørlykke [Thu, 1 Feb 2018 14:11:08 +0000 (15:11 +0100)]
json: Adjust whitespace

Change-Id: Ifa10ca415d291ab6b0cb06c475ac8697b5fc96da
Reviewed-on: https://code.wireshark.org/review/25548
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
6 years agoQt: Always show the Plugins tab in the about box.
Gerald Combs [Wed, 31 Jan 2018 21:45:22 +0000 (13:45 -0800)]
Qt: Always show the Plugins tab in the about box.

Always show the Plugins tab. We probably have plugins via extcap even if
Lua and dissector plugins are disabled. Tell the user if we don't find
any plugins.

Change-Id: I7ab1fb302298232a847193754b53688620855959
Reviewed-on: https://code.wireshark.org/review/25543
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
6 years agoQt: More byte view and proto tree fixes.
Gerald Combs [Wed, 31 Jan 2018 19:26:18 +0000 (11:26 -0800)]
Qt: More byte view and proto tree fixes.

47e1798762 broke byte view highlighting when selecting a proto tree
item. Switch back to emitting fieldSelected from selectionChanged. Force
a new selection in selectedFieldChanged, which does what we were trying
to do in 47e1798762.

Clear our marked byte offset in the byte view when we mark a field. Emit
byteSelected whenever we click the mouse.

Don't highlight anything when a tree item is deselected. Deselect a tree
item if we click on something that's not a byte in the byte view.

Change-Id: Ibf419ccb005d69f733b2fe12ce674e1fe504bb96
Reviewed-on: https://code.wireshark.org/review/25541
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
6 years agobuffer: add g_assert to all functions.
Dario Lombardo [Tue, 30 Jan 2018 16:39:03 +0000 (17:39 +0100)]
buffer: add g_assert to all functions.

This pacify clang warnings as well.

Change-Id: I5d61a82bfc43b93281f0d0caabcb7109c849788b
Reviewed-on: https://code.wireshark.org/review/25518
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
6 years agooss-fuzzshark: test code to debug some oss-fuzz assert fails.
Jakub Zawadzki [Thu, 1 Feb 2018 07:07:00 +0000 (08:07 +0100)]
oss-fuzzshark: test code to debug some oss-fuzz assert fails.

Change-Id: I5dbe899ca8a4f9107d62667ca107a4d3a48fe51b
Reviewed-on: https://code.wireshark.org/review/25545
Reviewed-by: Jakub Zawadzki <darkjames-ws@darkjames.pl>
6 years agoTDS: ensure to always initialize tds_encoding_char even when protocol is unknown
Pascal Quantin [Wed, 31 Jan 2018 14:32:29 +0000 (15:32 +0100)]
TDS: ensure to always initialize tds_encoding_char even when protocol is unknown

Otherwise we use an uninitialized variable

Bug: 14372
Change-Id: Idacdb40569421f7e41e181c14fb2bc033b0645b8
Reviewed-on: https://code.wireshark.org/review/25529
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
6 years agoQt: Avoid a potentially large memdup.
Gerald Combs [Wed, 31 Jan 2018 17:31:47 +0000 (09:31 -0800)]
Qt: Avoid a potentially large memdup.

Use QByteArray::fromRawData + tvb_get_ptr to create our ByteViewText
data instead of tvb_memdup. If our tvb lifetime is shorter than our
ByteViewText lifetime then that's a bug.

Change-Id: Iede275578a1493b8658308e0778f7f0799d6c6cd
Reviewed-on: https://code.wireshark.org/review/25534
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
6 years agoNew dissector Session Multiplex Protocol SMP
Uli Heilmeier [Mon, 15 Jan 2018 10:15:04 +0000 (11:15 +0100)]
New dissector Session Multiplex Protocol SMP

Adding Session Multiplex Protocol SMP
SMP is used by TDS when MARS in enabled.

Bug: 14110
Change-Id: Ia4113c627d107da6c3d51e4004265efb228a297b
Reviewed-on: https://code.wireshark.org/review/25509
Reviewed-by: Craig Jackson <cejackson51@gmail.com>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
6 years agobacapp: make sure to NUL terminate bf_arr.
Jakub Zawadzki [Thu, 1 Feb 2018 01:25:24 +0000 (02:25 +0100)]
bacapp: make sure to NUL terminate bf_arr.

bf_arr is used as %s argument to proto_tree_add_subtree_format(), so it need to be NUL terminated.
Add + 1 to bf_arr size, and use sizeof() in memset() calls.

ASAN report:

ERROR: AddressSanitizer: stack-buffer-overflow on address
0x7ff1b179f150 at pc 0x00000044cf31 bp 0x7ffdc7493cf0 sp 0x7ffdc74934a0
READ of size 258 at 0x7ff1b179f150 thread T0
SCARINESS: 41 (multi-byte-read-stack-buffer-overflow)
#0 0x44cf30 in printf_common(void*, char const*, __va_list_tag*) /src/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_format.inc:548
#1 0x498cfc in __vsnprintf_chk /src/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc:1558
#2 0x5775cf in proto_tree_set_representation /src/wireshark/epan/proto.c:5508:9
#3 0x577eb1 in proto_tree_add_text_valist_internal /src/wireshark/epan/proto.c:1226:2
#4 0x5782d5 in proto_tree_add_subtree_format /src/wireshark/epan/proto.c:1249:7
#5 0x73c73f in fBitStringTagVS /src/wireshark/epan/dissectors/packet-bacapp.c:7490:15
#6 0x73ad20 in fApplicationTypesEnumeratedSplit /src/wireshark/epan/dissectors/packet-bacapp.c:7569:26
#7 0x73a484 in fApplicationTypes /src/wireshark/epan/dissectors/packet-bacapp.c:7635:12
#8 0x7395db in fIAmRequest /src/wireshark/epan/dissectors/packet-bacapp.c:13412:14
#9 0x7383e1 in dissect_bacapp /src/wireshark/epan/dissectors/packet-bacapp.c:14163:9

Found by oss-fuzz/5452.

Change-Id: I57e948904f707c5003a389431b009a37c1212e04
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5452
Reviewed-on: https://code.wireshark.org/review/25544
Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jakub Zawadzki <darkjames-ws@darkjames.pl>
6 years agoieee80211: various fixes to the 802.11ax support.
Adrian Granados [Wed, 31 Jan 2018 14:43:57 +0000 (09:43 -0500)]
ieee80211: various fixes to the 802.11ax support.

Fixes/improves a few filter identifiers, typos, consistent
use of MHz (as opposed to Mhz), and fixes to the MCS map trees
in the HE Capabilities tag.

Change-Id: I5c761990237ccc241d95fb0b9b2d3f8f1263b460
Reviewed-on: https://code.wireshark.org/review/25530
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Petri-Dish: Richard Sharpe <realrichardsharpe@gmail.com>
Tested-by: Petri Dish Buildbot
6 years agoIAX2: always initialize src_vformat and dst_vformat
Pascal Quantin [Wed, 31 Jan 2018 14:59:16 +0000 (15:59 +0100)]
IAX2: always initialize src_vformat and dst_vformat

Bug: 14371
Change-Id: Icc027151fafd6db6ef8be18c9fc2ccf39518907f
Reviewed-on: https://code.wireshark.org/review/25531
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
6 years ago[MEGACO] Clear megaco_command between commands.
AndersBroman [Wed, 31 Jan 2018 13:44:20 +0000 (14:44 +0100)]
[MEGACO] Clear megaco_command between commands.

Change-Id: I62b9c9e192a6d5079c183a5b2e3ca7fa82c5bf39
Reviewed-on: https://code.wireshark.org/review/25528
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
6 years agohsrp: Fix UDP port number for HSRPv6
Stig Bjørlykke [Wed, 31 Jan 2018 12:54:47 +0000 (13:54 +0100)]
hsrp: Fix UDP port number for HSRPv6

The UDP port for HSRPv6 was mistyped when UDP dissectors was converted
to use "auto" preferences in g2eb7b05b8c.

Change-Id: I4b6f634677d23d81fc197dbeb43ee3d91d9a111f
Reviewed-on: https://code.wireshark.org/review/25526
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
6 years agoQt: fix compilation when building without Lua
Pascal Quantin [Wed, 31 Jan 2018 11:23:42 +0000 (12:23 +0100)]
Qt: fix compilation when building without Lua

Change-Id: Idb5d1016637c5d8968eae533d7688099edbeae3a
Reviewed-on: https://code.wireshark.org/review/25525
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
6 years agoQt: About dialog updates.
Gerald Combs [Mon, 29 Jan 2018 22:40:45 +0000 (14:40 -0800)]
Qt: About dialog updates.

Open lua scripts when double-clicked. Behavior depends on your system
configuration. Add tooltips accordingly.

Let Qt wrap the "Wireshark" tab information.

Set column widths by eyeballing their contents.

Elide the Folders and Plugins strings in the middle.

Fixup placeholder text capitalization.

Draw links using the palette link color.

Change-Id: Ic141eae05541480ec1e254c55fd81728d04713d9
Reviewed-on: https://code.wireshark.org/review/25510
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
6 years agoQt: Byte view and proto tree fixes.
Gerald Combs [Tue, 30 Jan 2018 22:59:35 +0000 (14:59 -0800)]
Qt: Byte view and proto tree fixes.

Select our byte field only when we enter marked / locked mode.

Emit fieldSelected from autoScrollTo so that we always set the marked
protocol.

Don't clobber the current index in saveSelectedField.

Change-Id: I967b20608f991a5f3e6a0979b1f702f874ce27b4
Reviewed-on: https://code.wireshark.org/review/25521
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
6 years agoQt: Write recent before applying profile changes
Stig Bjørlykke [Tue, 30 Jan 2018 12:17:01 +0000 (13:17 +0100)]
Qt: Write recent before applying profile changes

The selected profile may be renamed in apply_profile_changes()
so write the recent file before renaming the directory to ensure that
we reload the latest changes.

Change-Id: I8988a00647926d93b0a1903090aadc8c61f1a34e
Reviewed-on: https://code.wireshark.org/review/25516
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
6 years agoUI: Rename profiles without delete
Stig Bjørlykke [Tue, 30 Jan 2018 11:27:30 +0000 (12:27 +0100)]
UI: Rename profiles without delete

Do not try to delete the old profile name after renaming.  In most
cases it will not exist, but when using a case-insensitive file system
this will delete the renamed profile if only changing capitalizations
(first it's renamed and then it's deleted).

Change-Id: I27d2d22d2353b09f2041d82ea1cf1bae37a1ce3d
Reviewed-on: https://code.wireshark.org/review/25515
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
6 years agoIO Graph: Add some vector checks.
Gerald Combs [Tue, 30 Jan 2018 00:26:13 +0000 (16:26 -0800)]
IO Graph: Add some vector checks.

Use Qvector::value in a few places instead of an array index.

Change-Id: I821ef4b16df919977739c12ccaa3b9c3d53f049c
Ping-bug: 14357
Reviewed-on: https://code.wireshark.org/review/25511
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
6 years agoieee1905: add missing NULL terminatator to ieee1905_reporting_policy_flags[].
Jakub Zawadzki [Tue, 30 Jan 2018 22:23:17 +0000 (23:23 +0100)]
ieee1905: add missing NULL terminatator to ieee1905_reporting_policy_flags[].

Add missing NULL terminator to ieee1905_reporting_policy_flags[], in order to fix buffer overflow.

ASAN report:

ERROR: AddressSanitizer: global-buffer-overflow on address 0x0000092a4af8 at pc 0x00000062afd2 bp 0x7ffce7e468d0 sp 0x7ffce7e468c8
READ of size 8 at 0x0000092a4af8 thread T0
    #0 0x62afd1 in proto_item_add_bitmask_tree /src/wireshark/epan/proto.c:10406:9
    #1 0x62953f in proto_tree_add_bitmask_with_flags /src/wireshark/epan/proto.c:10786:3
    #2 0xfb8271 in dissect_metric_reporting_policy /src/wireshark/epan/dissectors/packet-ieee1905.c:2762:9
    #3 0xfb2997 in dissect_ieee1905_tlv_data /src/wireshark/epan/dissectors/packet-ieee1905.c:4390:18
    #4 0xfb23c8 in dissect_ieee1905 /src/wireshark/epan/dissectors/packet-ieee1905.c:4577:18

Found by oss-fuzz/5298.

Change-Id: I35dbd6d29d0a3a5560286146fbed172c810e5b2d
Link: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5298
Reviewed-on: https://code.wireshark.org/review/25520
Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jakub Zawadzki <darkjames-ws@darkjames.pl>
6 years agoQt: Fix crash when no plugins are configured
Jaap Keuter [Tue, 30 Jan 2018 16:22:09 +0000 (17:22 +0100)]
Qt: Fix crash when no plugins are configured

Configuring Wireshark with Cmake using -DENABLE_LUA:BOOL=OFF and
-DENABLE_PLUGINS:BOOL=OFF causes all plugin support to be removed.
The about Wireshark dialog wasn't made aware of that trying to
manipulate the related mdoel anyway, causing a crash.
Make the compilation of the offending code conditional.

Change-Id: Ifa51f40fda7f019d09327dc5650e5a55da2daf2a
Signed-off-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Reviewed-on: https://code.wireshark.org/review/25517
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
6 years agoRemove more unused images.
Gerald Combs [Tue, 30 Jan 2018 16:54:18 +0000 (08:54 -0800)]
Remove more unused images.

We stopped using various images in the following commits:

307c0d70fb (2011, not sure how they lasted that long)
clist_*.xpm

20cc0d7ce9 (2010)
stock_dialog_error_48.xpm
stock_dialog_info_48.xpm
stock_dialog_warning_48.xpm
stock_dialog_stop_48.xpm

2e4e229739 (2004)
stock_dialog_question_48.xpm

1a3e596609 (2011)
voip_select.xpm

194a145c8f (2013)
wssplash*.xpm

07c3d057b8 (2013)
openhand-16.png
rubberband-16.png

Change-Id: I3647cb2cb47e3927a4359f519ce45eb57e5aa534
Reviewed-on: https://code.wireshark.org/review/25519
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
6 years agoQt: Check for a valid capture file in the status bar.
Gerald Combs [Mon, 29 Jan 2018 17:42:08 +0000 (09:42 -0800)]
Qt: Check for a valid capture file in the status bar.

Rearrange the logic in showCaptureStatistics. Fixes a crash here when
capturing from stdin.

Change-Id: I7ec15a556579afe968a06a36d7914aa1631666df
Reviewed-on: https://code.wireshark.org/review/25507
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
6 years agoradiotap: Refactor some aspects of the radiotap dissector.
Richard Sharpe [Tue, 23 Jan 2018 14:56:15 +0000 (06:56 -0800)]
radiotap: Refactor some aspects of the radiotap dissector.

One thing I hate is big slabs of open coding. Compilers are very good these days
and will inline functions if they are used in only one place.

By using functions we make the code very much more readible.

There is also a big opportunity to use functions like proto_tree_add_bitmask.

Change-Id: I66d1509f577d2955996f4649e05494ab0370ed01
Reviewed-on: https://code.wireshark.org/review/24964
Petri-Dish: Richard Sharpe <realrichardsharpe@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>