Commit Graph

5483 Commits

Author SHA1 Message Date
Guy Harris 1f5f63f8ef Generalize wtap_pkthdr into a structure for packet and non-packet records.
Separate the stuff that any record could have from the stuff that only
particular record types have; put the latter into a union, and put all
that into a wtap_rec structure.

Add some record-type checks as necessary.

Change-Id: Id6b3486858f826fce4b096c59231f463e44bfaa2
Reviewed-on: https://code.wireshark.org/review/25696
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-09 00:29:51 +00:00
Dario Lombardo 8cd389e161 replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.
The first is deprecated, as per https://spdx.org/licenses/.

Change-Id: I8e21e1d32d09b8b94b93a2dc9fbdde5ffeba6bed
Reviewed-on: https://code.wireshark.org/review/25661
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-08 14:57:36 +00:00
Guy Harris 0f721985f1 Get rid of unneeded #includes.
Change-Id: Ica457e3fb2a6e2318ca1e03fb7b2569c7d8e6aba
Reviewed-on: https://code.wireshark.org/review/25679
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-08 03:31:04 +00:00
Gerald Combs 62fc862bc6 Squelch an rc warning.
Don't include glib if RC_INVOKED is defined so that the Microsoft Windows
Resource Compiler doesn't generate the following complaint:

\path\to\glib/gatomic.h(87): warning RC4011: identifier truncated to '__GCC_HAVE_SYNC_COMPARE_AND_SWA'

Change-Id: I6637aee2842de4e7041b66ff4428f617478efcb4
Reviewed-on: https://code.wireshark.org/review/25670
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>
2018-02-07 22:12:32 +00:00
Guy Harris 7ee8ead85c Include as "ui/summary.h", as is done elsewhere.
Change-Id: I832c74554854bf380984cab83a53e7ffe165ad84
Reviewed-on: https://code.wireshark.org/review/25658
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-07 09:12:10 +00:00
Guy Harris 40a533abe1 Move summary.[ch] to libui.
Change-Id: I49f1eeb4fc3a90e436da116577a7d0c5ba982eee
Reviewed-on: https://code.wireshark.org/review/25657
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-07 08:29:52 +00:00
Moshe Kaplan cd8c73a355 Generate HTTP Referer statistics
The main benefit of this feature is that it enables users to see the 
succession of HTTP requests that led to a specific request.

A sample PCAP is available here:
https://bugs.wireshark.org/bugzilla/attachment.cgi?id=16085

Change-Id: I7c521315b848fbce659fdc01e43f261d804a3a48
Reviewed-on: https://code.wireshark.org/review/25319
Reviewed-by: Moshe Kaplan <me@moshekaplan.com>
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-07 05:37:51 +00:00
Guy Harris f29bafff46 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: If1db5747c9e06faa7550162df8e04dc60b71d954
Reviewed-on: https://code.wireshark.org/review/25650
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-07 03:10:34 +00:00
Alexis La Goutte e6c0f03a42 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>
2018-02-06 13:56:17 +00:00
Gerald Combs ab202adb0a 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>
2018-02-06 07:19:09 +00:00
Guy Harris 5fcf5b9cc3 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>
2018-02-06 04:25:06 +00:00
Gerald Combs 1d999dea5c 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>
2018-02-05 05:10:10 +00:00
Gerald Combs ffc200ade3 [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>
2018-02-04 08:14:37 +00:00
Gerald Combs a4bb6c2d39 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>
2018-02-03 02:06:49 +00:00
Stig Bjørlykke d8565d8f1b 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>
2018-02-02 18:38:11 +00:00
Stig Bjørlykke 8604242e8f 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>
2018-02-02 13:42:06 +00:00
Dario Lombardo 819b8174a9 cli: use SPDX identifiers.
Change-Id: I7ce9b2a32f4ddad93ca1d9697c2a76b067f9e5f7
Reviewed-on: https://code.wireshark.org/review/25564
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-02-02 13:40:28 +00:00
Dario Lombardo e52172c775 Qt: use SPDX identifiers.
Change-Id: I111945c08f99818c249a868c12d9a7b3a3df64b3
Reviewed-on: https://code.wireshark.org/review/25563
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-02-02 13:39:36 +00:00
Dario Lombardo e5f4ef0c42 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>
2018-02-02 13:39:04 +00:00
Stig Bjørlykke c55974facc 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>
2018-02-02 09:36:47 +00:00
Dario Lombardo 6c13f7070c 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>
2018-02-02 05:29:42 +00:00
Stig Bjørlykke 8bf837eddc 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>
2018-02-02 00:17:53 +00:00
Gerald Combs 142c03516e 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>
2018-02-01 18:11:22 +00:00
Gerald Combs d4b5943ba8 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>
2018-02-01 16:55:03 +00:00
Gerald Combs c84b0aeead 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>
2018-02-01 14:04:25 +00:00
Gerald Combs 0c7bbc7536 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>
2018-02-01 02:05:06 +00:00
Pascal Quantin 210db80a54 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>
2018-01-31 12:20:18 +00:00
Gerald Combs f5a8711ef1 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>
2018-01-31 04:55:37 +00:00
Gerald Combs 47e1798762 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>
2018-01-31 04:54:36 +00:00
Stig Bjørlykke 55e74ba841 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>
2018-01-31 04:53:39 +00:00
Stig Bjørlykke 043b45e840 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>
2018-01-31 04:53:12 +00:00
Gerald Combs eda5c950b6 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>
2018-01-31 04:52:37 +00:00
Jaap Keuter 18f16c8b93 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>
2018-01-30 20:55:47 +00:00
Gerald Combs 461fb517d1 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>
2018-01-30 17:17:19 +00:00
Gerald Combs 9d87994b67 Byte view: Mark bytes using an outline.
Distinguish between hovered and marked bytes using a lighter and heavier
outline. Remove the "mark" color definitions.

Change-Id: Icf6363e920a634574b7a42a10ea77b538ce78290
Reviewed-on: https://code.wireshark.org/review/25513
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>
2018-01-30 08:39:04 +00:00
Dario Lombardo bc36e2a113 cli: free memory on exit in tap-comparestat (found by clang).
Change-Id: Ie4dfc68583fa6fc742baeaf9d9fd1c7d2f783f38
Reviewed-on: https://code.wireshark.org/review/25435
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-01-29 00:04:13 +00:00
Gerald Combs 10b9472659 [Automatic update for 2018-01-28]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I0b47c83ca6e62a24043fb5d546141e3e9af1e7b8
Reviewed-on: https://code.wireshark.org/review/25493
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-01-28 08:18:37 +00:00
Gerald Combs 557f6a4aed Qt: Translate some about box strings.
Change-Id: I2f9d1be83a26129e1206f32133b5ba6705f4dd85
Reviewed-on: https://code.wireshark.org/review/25471
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>
2018-01-27 08:29:27 +00:00
Stig Bjørlykke 98d1069066 Qt: Allow filter with deprecated syntax as button
Also update widgets at startup.

Bug: 14369
Change-Id: I2621b78289620a131bcad21d5ec23b048e4b218c
Reviewed-on: https://code.wireshark.org/review/25475
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2018-01-26 09:09:11 +00:00
Stig Bjørlykke 4762b78e45 Qt: Remove unused label_folders
Change-Id: I42d7ba0eed9cf2ad50e02a5385c6929e9b31882b
Reviewed-on: https://code.wireshark.org/review/25473
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-26 05:26:26 +00:00
Peter Wu 4398a92be2 Qt: Simplify files column in about dialog
HTMLTextDelegate fails to build in Qt 4.8, partially because
QStyleOptionViewItem.text is introduced with Qt 5. Another issue with
the current implementation is that the "Copy" action includes the HTML
tags for italics. To fix these, just remove the italics formatting.

Change-Id: I63aed7c3d0da3d9829d410d75fc18daa4049c0ca
Fixes: v2.5.0rc0-1822-g73c01d6d05 ("Qt: Rewrite the About dialog to use models")
Reviewed-on: https://code.wireshark.org/review/25470
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>
2018-01-26 05:25:57 +00:00
Peter Wu 9be01dc616 Qt 4.8 compatibility fixes
Add missing include headers, define Q_NULLPTR for all Qt objects (to
avoid having to include an ugly compat header), use old signal/slot
syntax (Q_SIGNALS are protected in Qt 4.8), disable Qt 5 log message
handler, etc.

Change-Id: I449beb0b74050fdfb0fc5828d8fb74eedb2b45bf
Reviewed-on: https://code.wireshark.org/review/25469
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-01-25 17:17:13 +00:00
Gerald Combs 350ca99d17 Qt: Adjust the about box layout.
Make sure the compile and build information is centered.

Change-Id: I2bfe502df4339c28d8c88553419b7d4d412a2be2
Reviewed-on: https://code.wireshark.org/review/25461
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>
2018-01-25 09:05:07 +00:00
Alexis La Goutte ccd2b53f40 byte_view_text (qt): Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
Change-Id: Ibfaac5e1d8cc30d6bb8917d0c0e10a79e059a53e
Reviewed-on: https://code.wireshark.org/review/25452
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-01-24 16:48:18 +00:00
Jakub Zawadzki 0d584d9fed ui: don't g_assert() in get_args_as_string(), but return empty string for no arguments case.
Rework e861a11210 by returning empty string.
g_assert() seems to be not understand by clang scan.

Change-Id: Iade2d81aa22eecf563a465cb86e694e3e0f853df
Reviewed-on: https://code.wireshark.org/review/25441
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-24 11:46:27 +00:00
Jakub Zawadzki 3a9da2e707 gtk: fix memory leak in profile dialog.
fill_list() don't break the loop when it founds first profile matching
name, and it can memleak if somehow it found more than one.
Don't break the loop to avoid regressions. Just g_free() previously found.
Found by clang.

Change-Id: I082b3f1d16f07580a6d7c814d2a8ee5463a44b0f
Reviewed-on: https://code.wireshark.org/review/25422
Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jakub Zawadzki <darkjames-ws@darkjames.pl>
2018-01-22 20:53:54 +00:00
Jakub Zawadzki e6eb4815cd gtk: Fix memory error/double free.
pathname is freed by caller of firewall_save_as_ok_cb(). Make pathname const.
Found by clang scan.

Change-Id: I3a0ab85494a9194edb825bae33eca979c7f8faf3
Reviewed-on: https://code.wireshark.org/review/25417
Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jakub Zawadzki <darkjames-ws@darkjames.pl>
2018-01-22 20:19:57 +00:00
Jakub Zawadzki 862c881318 traffic table: Fix memory leak
Free tpl_line in error path.
Founded by clang scan.

Change-Id: Iaaaaed155d859171ee880d520c11594b2d4d0b59
Reviewed-on: https://code.wireshark.org/review/25420
Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jakub Zawadzki <darkjames-ws@darkjames.pl>
2018-01-22 19:51:59 +00:00
Jakub Zawadzki 6e31943cd4 gtk: Fix memory leak.
free buffer in error path.
Found by clang scan.

Change-Id: I7c271b74e3e5ac9d4f2a550f3c83988a4594133d
Reviewed-on: https://code.wireshark.org/review/25416
Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jakub Zawadzki <darkjames-ws@darkjames.pl>
2018-01-22 19:22:41 +00:00
Jakub Zawadzki 257e7d19fd gtk: fix multiple memory leaks in prefs_capture
All leaks follow the same pattern if not gtk_tree_model_get_iter_first(),
than memory allocated was not used/ freed.
Put memory allocation under gtk_tree_model_get_iter_first() block.
Found by clang scan.

Change-Id: I8f9671ae5fb043343ab5dcdc39a57f1d28fec15b
Reviewed-on: https://code.wireshark.org/review/25418
Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jakub Zawadzki <darkjames-ws@darkjames.pl>
2018-01-22 18:52:49 +00:00