Commit Graph

6584 Commits

Author SHA1 Message Date
Guy Harris 608835bf56 Don't call any routines from WinPcap/Npcap packet32.dll.
We aren't using them now; stick to libpcap APIs (including Windows-only
libpcap APIs).

Change-Id: I812eaa31ba1e6e611418853105d3e00c9130a420
Reviewed-on: https://code.wireshark.org/review/37852
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-07-14 07:30:59 +00:00
Stig Bjørlykke 4fc9098830 Qt: Keep pane sizes when quit without loading a file
Change from master_split_.show() to packet_list_->show() in layoutPanes()
to avoid an issue where the pane sizes was stored with wrong values when
quit just after startup without loading a file.

This fixes a regression issue from g5ce52f74 and g7ebd5405.

Change-Id: I7ba1b5f8c9440d41d58dfd729013a0fd1e16be07
Reviewed-on: https://code.wireshark.org/review/37839
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2020-07-13 16:16:25 +00:00
Gerald Combs 300099e9e2 [Automatic update for 2020-07-12]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I68419eed3c7d203b483f51f09f56b863fd65ffd0
Reviewed-on: https://code.wireshark.org/review/37832
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-07-12 08:17:56 +00:00
Gerald Combs d0cd357825 Qt: Remove some dead code.
We no longer support Qt 5.2 or earlier.

Change-Id: I94ba6df2120956dadfce407fd999d39250485bc6
Reviewed-on: https://code.wireshark.org/review/37821
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: John Thacker <johnthacker@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-07-11 06:02:28 +00:00
John Thacker e84d431e39 QT: Don't use qAsConst and C+11 on QT < 5.7
Introduced QT 5.7 calls in my recent change (also C+11, which is
required for QT >= 5.7). Providing an alternate code path for QT < 5.7

Change-Id: I866af35138d4691a659aee756ce9c3ce4ffb933f
Reviewed-on: https://code.wireshark.org/review/37779
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2020-07-08 05:51:06 +00:00
Gerald Combs 4dc3114c05 Windows: Set our locale to ".UTF-8".
In each of our executables we were calling "setlocale(LC_ALL, "")" at
startup. This told Windows that output was encoded using the current
system code page. Unless the code page was 65001 (UTF-8), this was a lie.

We write UTF-8 to stdout and stderr, so call "setlocale(LC_ALL, ".UTF-8)"
at startup on Windows. This lets the CRT translate our output correctly
in more cases.

Clarify and expand the OUTPUT section in the tshark man page.

Bug: 16649
Change-Id: If93231fe5b332c292946c7f8e5e813e2f543e799
Reviewed-on: https://code.wireshark.org/review/37560
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-07-06 16:20:25 +00:00
John Thacker 9fc054a65b Add all supported charsets to Show Packet Bytes/Follow Stream
Use the QT text codec support to add charset conversions for all character
encodings supported by QT to Show Packet Bytes and Follow Stream (Save As
will convert to UTF-8.) Note that this is dynamic and the exact list will
depend on the version of QT and if libicu support is enabled. This does
make the list of codecs pretty long, so hopefully it shows up well on all
the different QT styles.

This does not yet support when multibyte characters span more than one packet
in Follow Stream, though the current code doesn't do that for UTF-8 or UTF-16
already. This is probably most useful for HTTP captures.

Bug: 16137
Change-Id: I6d5cd761a5d9d914b7a787fe8eb02b07b19642e6
Ping-Bug: 16630
Reviewed-on: https://code.wireshark.org/review/37707
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2020-07-06 14:21:41 +00:00
Gerald Combs 5e05fe0421 [Automatic update for 2020-07-05]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I4a369852fe1fbe2917932ba2a1f56eeb0fc4db28
Reviewed-on: https://code.wireshark.org/review/37703
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-07-05 08:15:50 +00:00
Martin Mathieson 0162ba730a Enable display filter autocomplete on find packet search.
Bug: 16638
Change-Id: Ifd9c9e4392fdc3d32b2aa4466d5a7f2835893338
Reviewed-on: https://code.wireshark.org/review/37682
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-07-05 07:46:41 +00:00
Stig Bjørlykke daebdc4b1a Qt: Handle filenames in preference editor frame
Add support for handling PREF_SAVE_FILENAME, PREF_OPEN_FILENAME and
PREF_DIRNAME in a preference editor frame.

Change-Id: Ie9d1cc08bc79a0adefff344fd0d117405f86475c
Reviewed-on: https://code.wireshark.org/review/37669
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2020-07-03 06:12:48 +00:00
Stig Bjørlykke a6d8a2c118 Qt: List all protocols in PacketList "Protocol Preferences"
Show all protocols which has preferences in the packet list context
menu "Protocol Preferences".

Change-Id: I72e2ed95db36cc6d817ca44db214782f075d55d6
Reviewed-on: https://code.wireshark.org/review/37666
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2020-07-03 06:12:40 +00:00
Stig Bjørlykke b8a330d2d5 Qt: Update ByteView recent settings on all tabs
The ByteView recent settings are common for all tabs. Ensure all
tabs are updated when display format or character encoding is changed.

This fixes an issue where the row_width is wrong and the menu action
checkmarks are out of sync after switching ByteView tab.

Change-Id: Ied25ac41467143f37327ccadcb821262eb86ef0a
Reviewed-on: https://code.wireshark.org/review/37655
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2020-07-03 06:11:56 +00:00
Stig Bjørlykke dd247d821e Qt: Remove ellipsis from "Disable protocol" menu item
The protocol preferences menu item for disabling the protocol does
not bring up a new dialog, so remove the ellipsis.

Change-Id: I210bd6d5f76ce240f1d2a2d1a852e176a48ea1f0
Reviewed-on: https://code.wireshark.org/review/37667
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-07-02 11:17:09 +00:00
Stig Bjørlykke 408bc4cb1d Qt: Add keyboard shortcut for Decode As
Add keyboard shortcut Ctrl+Shift+U (User specified decodes) to bring
up the Decode As dialog.

Change-Id: Idd720431f87a5b645fdb151ef6d37347d26dbf1c
Reviewed-on: https://code.wireshark.org/review/37617
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2020-07-02 06:13:36 +00:00
Stig Bjørlykke 9a1a5fd22a Qt: Add copy from another profile for Decode As
Add a new button to the Decode As dialog to copy entries from
another profile.

Change-Id: Ia04edd063bd2eba14b2b14acfd53b03111646f7e
Reviewed-on: https://code.wireshark.org/review/37616
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2020-07-02 06:13:27 +00:00
Stig Bjørlykke cb5bb6c99b Qt: Use elided heading in filter menus
The heading in Apply as Filter and Prepare as Filter may be very
wide for byte arrays. Use ElideRight with an appropriate length
to limit the menu width.

Change-Id: I2b8f5c805d8fd180c23a211fb7a88d16591175d0
Reviewed-on: https://code.wireshark.org/review/37641
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-07-02 04:59:49 +00:00
Martin Mathieson 570a0cb301 Set member variables in initialiser list (rather than in CTOR bodies).
Also simplify some boolean logic in packet-dcerpc.c.
All reported by cppcheck.

Change-Id: I2075f2ec10dc777ad7635da4ef056d17fc5b0be0
Reviewed-on: https://code.wireshark.org/review/37609
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2020-06-30 12:11:15 +00:00
Stig Bjørlykke 52512329c2 Qt: Accept changes in Decode As when combo box has focus
Accept changes in the Decode As dialog on Save and Ok even when the
Field or Current combox box still has focus.

Change-Id: I9d6277ff57714679b574756cbc6d4c4dcb06f8e2
Reviewed-on: https://code.wireshark.org/review/37580
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2020-06-29 18:43:20 +00:00
rbroker 1f75d7b3b9 wslua: Add ability to query current temporary color filter text
The LUA API provides the "set_color_filter_slot" function, but without
a corresponding "get_" function, it's very hard for two LUA dissectors
to co-exist without one overwriting any color filters set by the other.

It also looks like the documentation comment for
"set_color_filter_slot" had an off-by-one error, which I've corrected
as I was adding almost identical documentation for the new API.

Change-Id: Ic54d23be555ec12e1830bbe6f84a1b04d04fd4f0
Reviewed-on: https://code.wireshark.org/review/37511
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-06-25 08:02:27 +00:00
Gerald Combs dad321fb0e [Automatic update for 2020-06-21]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I951278c0a2fc5feb434c093c3ad5f94c651ba498
Reviewed-on: https://code.wireshark.org/review/37531
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-06-21 08:16:16 +00:00
Roland Knall c0b7a1d6eb Qt: Fix separator for FilterExpressions
Change the separator from && to // due to popular support for
that separator instead.

Bug: 16498
Change-Id: I0ee934f3f8a7b9ff1c062b533046980e3feb3d99
Reviewed-on: https://code.wireshark.org/review/37465
Reviewed-by: Roland Knall <rknall@gmail.com>
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-06-15 05:03:35 +00:00
Gerald Combs 78bcdca8d3 [Automatic update for 2020-06-14]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I158820fb33a2148f1075a59e2fec50edf10b9ecf
Reviewed-on: https://code.wireshark.org/review/37471
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-06-14 08:15:57 +00:00
Pascal Quantin c97076b7d7 MAC LTE: add support for extended LCID
This feature introduced in V15.5.0 allows to have up to 15 DRBs by
adding LCID 32 to 38

Change-Id: I4442e26d115efe484eda4f2d8921483cf4278b99
Reviewed-on: https://code.wireshark.org/review/37462
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal@wireshark.org>
2020-06-12 04:13:25 +00:00
Roland Knall 6f700a9da6 Qt: Fix zip import/export on Windows
On Windows, cleaning up the filename inside the zip
failed due to the backslash not properly being recognized.
This lead to profiles, which could not be imported on another
machine, if the filename contained a path not existing there.

Bug: 16608
Change-Id: Ib30b2370e30c30ac60f283edf6376c07258c25b6
Reviewed-on: https://code.wireshark.org/review/37437
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2020-06-10 12:49:18 +00:00
Gerald Combs 668161f8dd [Automatic update for 2020-06-07]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I09905565b83aeb28c1976d321a32f616f4527e25
Reviewed-on: https://code.wireshark.org/review/37390
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-06-07 08:18:28 +00:00
Gerald Combs 2318cbd8bc Qt: Fix a Qt 5.15 deprecation warning for QProcess.
Move our explorer.exe selection to a separate argument.

Change-Id: Id1f3d565a567fef30190b6abd1ba8f7bc3805911
Reviewed-on: https://code.wireshark.org/review/37362
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>
2020-06-03 08:52:25 +00:00
Martin Mathieson e0eefe186a Fix some cppcheck issues:
- Some redundant assignments or tests.
- Some declarations were changed to match definitions in terms of
including _U_ for the same parameters
- Some parenthesis added/changed to made precedence more obvious

epan/color_filters.c:533: style: Variable 'name' is reassigned a value before the old one has been used.
epan/color_filters.c:534: style: Variable 'filter_exp' is reassigned a value before the old one has been used.
asn1/tcap/packet-tcap-template.c:2199: warning: Function 'dissect_tcap_ITU_ComponentPDU' argument order different: declaration '_U_, tvb, offset, _U_, tree, _U_' definition '_U_, tvb, offset, actx, tree, _U_'
epan/dissectors/packet-aim.c:2546: warning: Function 'dissect_aim_tlv_value_icq' argument order different: declaration 'ti, subtype, tvb, _U_' definition 'ti, _U_, tvb, pinfo'
epan/dissectors/packet-arp.c:1133: style: Clarify calculation precedence for '&' and '?'.
epan/dissectors/packet-arp.c:1143: style: Clarify calculation precedence for '&' and '?'.
epan/dissectors/packet-arp.c:1158: style: Clarify calculation precedence for '&' and '?'.
epan/dissectors/packet-arp.c:1168: style: Clarify calculation precedence for '&' and '?'.
epan/dissectors/packet-gtpv2.c:5997: warning: Function 'dissect_gtpv2_mbms_service_area' argument order different: declaration 'tvb, _U_, tree, _U_, _U_, _U_, _U_, _U_' definition 'tvb, _U_, tree, item, _U_, _U_, _U_, _U_'
epan/dissectors/packet-gtpv2.c:6291: warning: Function 'dissect_gtpv2_mbms_time_to_data_xfer' argument order different: declaration 'tvb, _U_, tree, _U_, _U_, _U_, _U_, _U_' definition 'tvb, _U_, tree, item, _U_, _U_, _U_, _U_'
epan/dissectors/packet-gtpv2.c:6369: warning: Function 'dissect_gtpv2_epc_timer' argument order different: declaration 'tvb, _U_, tree, _U_, _U_, _U_, _U_, _U_' definition 'tvb, _U_, tree, item, _U_, message_type, _U_, _U_'
epan/dissectors/packet-knxip.c:2939: style: Condition 'mac_error' is always false  (just added comment)
epan/dissectors/packet-mac-lte.c:4386: style: Clarify calculation precedence for '&' and '?'.
epan/dissectors/packet-nas_5gs.c:1828: style: Variable 'nas5gs_data->payload_container_type' is reassigned a value before the old one has been used. (noted confusing recursion)
epan/dissectors/packet-rpcrdma.c:587: warning: Identical condition 'offset>max_offset', second condition is always false
epan/dissectors/packet-rsl.c:2098: style: Assignment of function parameter has no effect outside the function.

Change-Id: Ib5c9a04cfb6e6233972bc041434601c8ef09c969
Reviewed-on: https://code.wireshark.org/review/37343
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2020-06-01 20:44:27 +00:00
Gerald Combs 2ca5a14513 Qt: Fix some Qt 5.15 deprecation warnings.
Use Qt::ItemFlags() instead of 0.

Use QFileDialog::Options() instead of 0.

Use QComboBox::textActivated instead of QComboBox::activated.

Switch to just using Qt::WindowFlags() in GeometryStateDialog. This
*should* work for Qt 5.5 and earlier, but if it doesn't we can switch
back.

Change-Id: Iaf4e7efa1a11fc7f3325b449eef1be308cd21b45
Reviewed-on: https://code.wireshark.org/review/37349
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-06-01 08:20:01 +00:00
Gerald Combs 5e0ebc9fc0 [Automatic update for 2020-05-31]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I85f6df38480057cab59cf3edc6b6fb12dd116afc
Reviewed-on: https://code.wireshark.org/review/37339
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-05-31 08:17:44 +00:00
Nardi Ivan c416e2ff37 Qt: improve performance of related packet delegate
Use proper functions to lookup/iterate elements in QHash
Avoid useless lookup

Change-Id: I7a115ae5ed35b31599f33050e36bf68007167a96
Reviewed-on: https://code.wireshark.org/review/37304
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2020-05-30 07:50:12 +00:00
Gerald Combs 4e6f47fa62 Qt: Make our exported and saved line endings consistent.
Make sure we set QIODevice::Text on our QTextStreams when saving and
exporting text so that we get native line endings on Windows.

Change-Id: I4602157d2d170eb9a2c79032254ea5be236c7589
Reviewed-on: https://code.wireshark.org/review/37336
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>
2020-05-30 06:46:01 +00:00
Gerald Combs 76d92ba7e7 Qt: Updates for 5.15.
Fix the following deprecation issues for Qt 5.15:

Use Qt::WindowFlags() instead of 0 in Qt >= 5.6.

Pass Qt::SkipEmptyParts instead of QString::SkipEmptyParts to QString::split() in Qt >= 5.15.

Use QMultiMap instead of QMap where we were using QMap::uniqeKeys().

Use QCP::Interactions() instead of 0.

Use '\n' instead of QTextStream::endl.

Use QWheelEvent::angleDelta() instead of QWheelEvent::angle().

Change-Id: Ie2d69d3a396c0821c2c34f506ddad6f8e22f7049
Reviewed-on: https://code.wireshark.org/review/37334
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>
2020-05-30 06:45:07 +00:00
Gerald Combs 567d9d38da [Automatic update for 2020-05-24]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: If34f97445bfdd336cd369567fbbd004129e487d5
Reviewed-on: https://code.wireshark.org/review/37293
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-05-24 08:17:19 +00:00
Gerald Combs 238781fe91 [Automatic update for 2020-05-17]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I48106b3648d1a699f3153210f68765604e226e8e
Reviewed-on: https://code.wireshark.org/review/37238
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-05-17 08:16:24 +00:00
Gerald Combs a941457d91 [Automatic update for 2020-05-10]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: If6b68e242160198aed0de5947813d0db20c799f2
Reviewed-on: https://code.wireshark.org/review/37173
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-05-10 18:18:48 +00:00
Martin Mathieson 569f3bd611 More PVS-Studio issues flagged by Valerii Zapodovnikov.
/opt/SourceCode/wireshark/epan/dissectors/packet-frame.c	818	warn	V547 Expression 'fi' is always true.
/opt/SourceCode/wireshark/epan/dissectors/packet-gsm_sms.c	2692	warn	V547 Expression 'length <= (offset - saved_offset)' is always false.
/opt/SourceCode/wireshark/epan/dissectors/packet-isup.c	4688	warn	V1037 Two or more case-branches perform the same actions. Check lines: 4688, 4697
/opt/SourceCode/wireshark/extcap/androiddump.c	1237	warn	V560 A part of conditional expression is always true: data_str.
/opt/SourceCode/wireshark/extcap/androiddump.c	1603	warn	V547 Expression is always true.
/opt/SourceCode/wireshark/ui/qt/models/packet_list_model.cpp	497	warn	V560 A part of conditional expression is always true: ok_r1.

For the voip_calls.c change, I preferred to initailize along with every other field, rather than set to actual value it gets set to later.

For the isobus-vt change, I could not find a spec but followed the pattern from other error bit fields.

Bug: 16335
Change-Id: Ie55082222b582f6fff4e8c7a992d863acee6cf15
Reviewed-on: https://code.wireshark.org/review/37160
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2020-05-09 11:34:12 +00:00
Tomasz Moń 63a8ac5210 Qt: Respect user preference to hide packet list
Instead of hiding whole packet list widget when freezing, hide only the
header. This prevents unwanted column resizes while keeping the widget
on screen while capture file is loading.

Prevent flickering by showing master_split_ only after all widgets are
in correct place.

Ping-Bug: 16063
Ping-Bug: 16491
Change-Id: I3bb0763c44b23b1e4118003502d4bf3903591f34
Reviewed-on: https://code.wireshark.org/review/37159
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-05-08 04:07:35 +00:00
Martin Kaiser 5d3eea14a3 ConversationDialog: fix a TCP graph race condition
When the user opens the conversation dialog, selects a tcp conversation and
presses the Graph button, the ConversationDialog kicks off these two actions

1.) apply a display filter "tcp.stream eq X" (where X is the number of the stream)
2.) open the tcp stream graph

Both actions are asynchronous and, at least on my machines, the graph is opened
before the filter is applied. The graph requires that the current packet be
part of the selected tcp conversation. If it's not (because the filter isn't
applied yet), we get the "Selected packet isn't a TCP segment or is truncated"
error message and the graph is not shown.

Fix this by enforcing the correct order for the two actions. MainWindow sends
the displayFilterSuccess signal when a display filter was applied. Listen to this
signal in ConversationDialog and launch the tcp graph when the filter was
applied successfully.

Change-Id: I63debe2125ba8f0a737ff4882a9fca0a7bcdb0f5
Reviewed-on: https://code.wireshark.org/review/37130
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-05-07 03:48:47 +00:00
Martin Mathieson a5703f22cb More changes arising from PVS-Studio output.
/opt/SourceCode/wireshark/epan/dissectors/packet-ip.c	1556	err	V547 Expression 'opt == (1 | 0x00)' is always true.
/opt/SourceCode/wireshark/epan/dissectors/packet-ipdc.c	739	warn	V547 Expression 'payload_len < 4' is always false.
/opt/SourceCode/wireshark/ui/text_import.c	1049	err	V547 Expression 'info->offset_type == OFFSET_DEC' is always true.

None of these are actual bugfixes.

Bug: 16335
Change-Id: I6d0d3bb92c70ea625fc8b559e7a2bc5ba4e29e25
Reviewed-on: https://code.wireshark.org/review/37136
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2020-05-06 08:35:11 +00:00
Tomasz Moń 1d0b233f12 Qt: Stretch last packet list header section
Programatically show the master split widget before elements are added
to prevent pending resize events from resizing packet columns to insane
widths (in my case orders of magnitude higher than display resolution)

Such resize was occuring when loading capture file if configuration file
included hidden columns (e.g. 55 defined columns, 8 visible). The resize
was not directly visible to user. Resize event call chain included calls
to recent_set_column_width() that changed width stored in configuration.
Modified configuration column width value would become effective after
user added or removed columns.

Hide PacketList when freezing and show it when thawing. Do not call
setUpdatesEnabled(false) as it leads to widget/preferences columns
missynchronization.

Clear packet list before freeing frame data. This prevents accessing
freed memory in ProtoTree on file close if packet list was in focus and
the next widget to get focus is packet details.

Ping-Bug: 16063
Bug: 16491
Change-Id: I2c21d928348681af1793b3263815c81ee73d41b0
Reviewed-on: https://code.wireshark.org/review/37029
Petri-Dish: Tomasz Moń <desowin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-05-06 03:50:18 +00:00
Martin Mathieson 1408dd3b50 Last batch of changes from PVS-Studio scan.
/opt/SourceCode/wireshark/epan/dissectors/packet-flip.c	155	warn	V547 Expression 'chksum_hdr_chksum == computed_chksum' is always false.
/opt/SourceCode/wireshark/epan/dissectors/packet-zbee-zcl-meas-sensing.c	1295	err	V590 Consider inspecting the '(value > 0x0000) || (value > 0xfffd)' expression. The expression is excessive or contains a misprint.
/opt/SourceCode/wireshark/ui/qt/lte_rlc_statistics_dialog.cpp	504	warn	V668 There is no sense in testing the 'channel_item' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error.

Bug: 16335
Change-Id: Ief19a82e84bd16df33c453d6cc30db37f1c589ea
Reviewed-on: https://code.wireshark.org/review/37150
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2020-05-05 18:41:30 +00:00
Aurelien Aptel 9e299c1166 ui/capture.h: add missing include to fix build with GCC 9.3
ui/capture.h has a function prototype using capture_file struct
without it being defined yet. This fails to compile with recent
GCC (9.3.1)

Bug: 16547
Change-Id: I84f932de2e7ed70f14aa157b9c3b1d1f80b0016f
Signed-off-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-on: https://code.wireshark.org/review/37024
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-05-04 11:22:22 +00:00
Guy Harris c9735a3da9 Generate a dummy description if we don't have an interface name.
Just have a display name and description of "(Unknown)" if we have no
display name, no description, *and* no interface name.

Change-Id: I8403779c17c1e6d96d5ba29941081f560ad5339c
Reviewed-on: https://code.wireshark.org/review/37086
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-05-03 21:22:17 +00:00
Guy Harris bd963200ce Clean up some issues with get_iface_list_string().
Remove an assignment of NULL to a variable when it's in a branch of code
where the variable's already known to be NULL.  Found by PVS-Studio.

Pull get_display_name_for_interface() into the one place it's used.
That:

    allows us to eliminate a test as, inside the loop where it's called,
    the loop index is what's passed to it, and the loop tests whether
    it's in range, so the test will never fail;

    means we just set interface_opts once, for both of the places it's
    used.

Then we fix that code so that it sets interface_opts->descr to a
generated descriptive name if it *is* null, rather than if it's *not*
null.

That should clean up some issues found by 1) PVS-Studio and 2) me.

Change-Id: I4188ca8f5c7306477ef11117016691d1c9f0267f
Reviewed-on: https://code.wireshark.org/review/37082
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-05-03 20:45:29 +00:00
Martin Mathieson 0b1e27ec77 voip_calls: Fix leak of GString from unistim handling.
/opt/SourceCode/wireshark/ui/voip_calls.c	3786	err	V773 The function was exited without releasing the 'g_tmp' pointer. A memory leak is possible.

Tested with unistim_call.pcap from SampleCaptures.

Bug: 16335
Change-Id: I8518a3e277e8acec15e09ca5f36672b5bdd181fe
Reviewed-on: https://code.wireshark.org/review/37028
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-05-03 19:07:53 +00:00
Martin Mathieson 6ba8bd037f Some more issues identified by PVS-Studio.
/opt/SourceCode/wireshark/epan/dissectors/packet-osc.c	367	err	V562 It's odd to compare 0 or 1 with a value of 0.
/opt/SourceCode/wireshark/epan/dissectors/packet-rpc.c	960	note	V576 Incorrect format. Consider checking the eighth actual argument of the 'proto_tree_add_subtree_format' function. The SIGNED integer type argument is expected.
/opt/SourceCode/wireshark/epan/dissectors/packet-rpc.c	980	note	V576 Incorrect format. Consider checking the third actual argument of the 'proto_item_append_text' function. The SIGNED integer type argument is expected.
/opt/SourceCode/wireshark/epan/dissectors/packet-rpc.c	2473	note	V576 Incorrect format. Consider checking the fourth actual argument of the 'col_prepend_fstr' function. The SIGNED integer type argument is expected.
/opt/SourceCode/wireshark/epan/dissectors/packet-rpc.c	2482	note	V576 Incorrect format. Consider checking the fourth actual argument of the 'col_append_fstr' function. The SIGNED integer type argument is expected.
/opt/SourceCode/wireshark/epan/dissectors/packet-rpc.c	2633	note	V576 Incorrect format. Consider checking the fourth actual argument of the 'col_append_fstr' function. The SIGNED integer type argument is expected.
/opt/SourceCode/wireshark/epan/dissectors/packet-rpc.c	2650	note	V576 Incorrect format. Consider checking the fourth actual argument of the 'col_prepend_fstr' function. The SIGNED integer type argument is expected.
/opt/SourceCode/wireshark/epan/dissectors/packet-stun.c	565	warn	V1051 Consider checking for misprints. It's possible that the 'reported_length' should be checked here.
/opt/SourceCode/wireshark/epan/dissectors/packet-umts_fp.c	4126	warn	V1051 Consider checking for misprints. It's possible that the 'reported_length' should be checked here.
/opt/SourceCode/wireshark/epan/dissectors/packet-umts_fp.c	4942	warn	V1051 Consider checking for misprints. It's possible that the 'reported_length' should be checked here.
/opt/SourceCode/wireshark/ui/voip_calls.c	1444	err	V773 The 'comment' pointer was assigned values twice without releasing the memory. A memory leak is possible.
/opt/SourceCode/wireshark/wsutil/filesystem.c	1531	err	V773 The function was exited without releasing the 'files' pointer. A memory leak is possible.
/opt/SourceCode/wireshark/wsutil/filesystem.c	1717	err	V773 The function was exited without releasing the 'files' pointer. A memory leak is possible.

Bug: 16335
Change-Id: I8df3ba6d070823dcb43c4152d9156358f701e8dc
Reviewed-on: https://code.wireshark.org/review/37069
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-05-03 19:04:30 +00:00
Gerald Combs bf3d14ca4e [Automatic update for 2020-05-03]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: Iee0627e305ea5b5b9b01c69175a0ea8a52195586
Reviewed-on: https://code.wireshark.org/review/37062
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-05-03 08:08:59 +00:00
Guy Harris 582ad24c38 Remove some single-SHB assumptions.
Make wtap_file_get_shb() take a section number argument, and update code
that called it.  In most cases, we convert the code to iterate over
sections; in cases where a big code change would be required, we
temporarily pass it 0 and mark the code as "needs to be updated for
multiple sections".

Eliminate cf_read_section_comment(); in calls outside file.c, other code
directly calls the libwiretap routines it calls and, inside file.c, we
just transplant the code and then fix it not to assume a single SHB.

Change-Id: I85e94d0a4fc878e9d937088759be04cb004e019b
Reviewed-on: https://code.wireshark.org/review/37000
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-05-01 19:46:42 +00:00
Roland Knall adb8feee6d Qt: Allow renaming personal profile
If a personal profile has the same name as a global profile (which
is usually the case if it has been copied without changing the name
afterwards), there was a bug where renaming the profile was no longer
possible.

Bug: 16423
Change-Id: Idafd216d007179a4c6221eafc2ff296d277d5b1d
Reviewed-on: https://code.wireshark.org/review/36902
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Roland Knall <rknall@gmail.com>
2020-04-30 11:19:41 +00:00
Martin Kaiser 7bd3f8a58f LteMacStatisticsDialog: fix memory leaks
Remember the delegates that we use and free them explicitly
in the destructor.

Change-Id: Iba07c3e9952dc152d94468b6b7c7e2c2a74c1f65
Reviewed-on: https://code.wireshark.org/review/36965
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-04-29 03:35:44 +00:00