Commit Graph

3042 Commits

Author SHA1 Message Date
Gerald Combs 89e6f4c468 Qt: Add the Protocol Hierarchy statistics dialog.
Change-Id: I6872e323daca4798c638d764873f54c4c0dc0006
Reviewed-on: https://code.wireshark.org/review/6934
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-04 02:06:01 +00:00
Guy Harris 0e74e8b0cc Decorate declarations with G_GNUC_PRINTF() as appropriate.
Decorate val_to_qstring() and val_ext_to_qstring() similarly to
val_to_str_wmem(); this squelches some compiler warnings.

Change-Id: I86e102e7c0a1a135be9492b7d605001c5d922031
Reviewed-on: https://code.wireshark.org/review/6940
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-04 00:25:56 +00:00
Dario Lombardo 9b22a2f895 Updates in it translation.
This fixes also the "duplicate messages" error.

Change-Id: Iec93d82d4776c4f9805c5bfa2b2453c22b0e24e8
Reviewed-on: https://code.wireshark.org/review/6929
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-02-03 23:22:44 +00:00
Michael Mann b635997624 Convert val_to_str_ext -> val_to_str_ext_wmem for calls that don't have valid packet scope (GUI).
val_to_str_ext now officially uses wmem_packet_scope().

Removed const from val_to_str[_ext]_wmem return value since it's not really constant.

Created utility functions in qt_ui_utils.h to help with the new memory management for its GUI.

Change-Id: Idf2ce4a4ce78d628b2269ad23a3a48fbfc9c077c
Reviewed-on: https://code.wireshark.org/review/6926
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-02-03 13:03:32 +00:00
Gerald Combs 00f7bc4b3d Qt: Fix IO Graph capture file closing.
Make sure our IOGraphs remove their respective tap listeners before the
capture file closes, otherwise the graph data ends up getting cleared
via reset_tap_listeners.

Bug: 10871
Change-Id: I0ef2af2dc84be1921a930df8bb68f63626aa874a
Reviewed-on: https://code.wireshark.org/review/6925
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-03 01:20:36 +00:00
Alexis La Goutte 003e3373f5 Fix some indent typo (after g2bf7878e)
Change-Id: I44769f127f32ffd8a97b1579f371501f4aa9832a
Reviewed-on: https://code.wireshark.org/review/6913
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-02 12:37:06 +00:00
Guy Harris 3947091a50 Fix a typo.
Change-Id: I2724340e41572fdaa56ebf75478297090563c522
Reviewed-on: https://code.wireshark.org/review/6895
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-01 21:03:13 +00:00
Guy Harris cca2cde68e No main window *to* update in the early argument list parsing.
We haven't yet popped the main window up, so, when we call
capture_interface_list(), we shouldn't pass a pointer to the "update the
main window" routine.

Change-Id: Id3e02199479e66bb9e9aff99b435bd03af45a1af
Reviewed-on: https://code.wireshark.org/review/6868
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-31 04:03:58 +00:00
Gerald Combs e76e14074e Qt: Fix library path reset.
g9a3676a reset the Qt library path *after* wsApp was instantiated, which
is too late. Do so before QCoreApplication has a chance to do anything
we might regret.

Change-Id: Ibbdb69d1b7c0ea4bf1042e98a5bb5deba13e954e
Reviewed-on: https://code.wireshark.org/review/6864
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-01-30 23:37:18 +00:00
Gerald Combs 9a3676accb Qt: Clear our library path at startup on Windows.
I recently rebuilt my Windows development VM and discovered that I could
no longer run Wireshark executables from wireshark.org. Trying to do so
failed with the following error:

----
This application failed to start because it could not find or load the
Qt platform plugin "windows".

Available platform plugins are: minimal, offscreen, windows, windows.

Reinstalling the application may fix this problem.
----

As it turns out there are two issues. According to
http://doc.qt.io/qt-5/windows-deployment.html The search path
for Qt plugins is hard-coded into the QtCore library. Dependency
Walker confirmed this, showing that Qt5Core.dll tried to load
C:\Qt\5.3\msvc2013_64_opengl\plugins\platforms\qwindows.dll instead of
C:\Program Files\Wireshark\platforms\qwindows.dll.

The second issue is that the Qt online installer only uses the major
and minor version, e.g. C:\Qt\5.3. This means that you can end up with
Qt 5.3.0, .1, .2, or .3 depending on *when* you run the installer.

The Windows builders have 5.3.1 installed while my development VM
has 5.3.2. Apparently qwindows.dll is not compatible between these two
versions, hence the startup error. (...so what happens if you can create
a malicious qwindows.dll which *is* compatible on someone's machine?)

This change removes any entries from QCoreApplication::libraryPaths that
don't match our executable path. This shouldn't be an issue in our case
because both the NMake+QMake and CMake environments run windeployqt to
copy in any required DLLs.

If it *is* an issue or if clearing the library path list causes other
problems I can reinstall Qt on the Windows builders into a unique and
obvious path, e.g. C:\Qt-check-your-path-before-you-wreck-your-path\5.3

Change-Id: I1918bc4e520aba32cfcf9f4ccd37bf9255058cbe
Reviewed-on: https://code.wireshark.org/review/6863
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-01-30 21:11:04 +00:00
Gerald Combs 2bf7878e8a Qt: Add the RTP Streams dialog.
Add keyboard shortcuts. Note that not all of the buttons made it from
GTK+.  Add a "Go to setup frame" option.

Move rtp_streams.c from ui/gtk to ui.

Add a help URL for RTP analysis (which needs to be split into streams +
analysis).

Fix RTP stream packet marking.

Change-Id: Ifb8192ff701a933422509233d76461a46e459f4f
Reviewed-on: https://code.wireshark.org/review/6852
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-01-30 06:48:32 +00:00
Gerald Combs 67b069e544 Qt: Add address conversion convenience routines
Add address_to_qstring and address_to_display_qstring, which wrap
address_to_string and address_to_display respectively and return
QStrings. Convert most of the instances in ui/qt to the new routines.

Fix a some memory leaks in the process.

Change-Id: Icda80bbfe0b2df723d54c8da84355255f819af89
Reviewed-on: https://code.wireshark.org/review/6848
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-01-29 22:51:43 +00:00
Alexis La Goutte 83678a05ea Proto dialog (GTK) : fix indent (use 2 spaces) and add modelines
Change-Id: I36945843b8d544188a3ffe89f397e669f3944593
Reviewed-on: https://code.wireshark.org/review/6831
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-28 12:46:31 +00:00
Gerald Combs 3aab6fc90e Qt: Update packet list freeze/thaw behavior.
Move the clear() calls in gee320ef a bit earlier in the code to
PacketList::freeze. No model means no packets.

Bug: 10896
Change-Id: Ie440e3da4c5fb601048f4e94c8712ecf2d864d4f
Reviewed-on: https://code.wireshark.org/review/6823
Reviewed-by: Sean Stalley <seanstalley@gmail.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-01-27 21:26:14 +00:00
Dario Lombardo 9bbc337306 Added HPFEEDS stats_tree.
Change-Id: I256fd5395b062fa954ebd60598721323ea1d7ff1
Bug: 10875
Reviewed-on: https://code.wireshark.org/review/6713
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-27 13:19:20 +00:00
Alexis La Goutte 32cbf791e6 Qt: Add checkable for Find Packet icon
Change-Id: Idd3c0b1893a9e0f8bc329e9157baaccd10de7378
Reviewed-on: https://code.wireshark.org/review/6814
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-27 12:47:35 +00:00
Alexis La Goutte b5a3907a71 Packet List (Qt): fix extra ‘;’ [-Wpedantic]
Change-Id: I3ac80a13da91452de4c857abfd6f2661b00e2f5d
Reviewed-on: https://code.wireshark.org/review/6815
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-27 12:47:05 +00:00
Alexis La Goutte 77227d40bf GTK: Fix multispace on main title bar
Change-Id: I275a586c16621fdfabede23f6a1d03c8d8556b3f
Reviewed-on: https://code.wireshark.org/review/6813
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-27 12:45:27 +00:00
Alexis La Goutte ec7ff4e25d GTK: fix no previous prototype for ... [-Wmissing-prototypes]
Add by commit g43f09e67b (Remove unneeded includes from ui folder)

Change-Id: I66eb113430bde97e18bb3d2b00f6bac46a01797e
Reviewed-on: https://code.wireshark.org/review/6809
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-27 12:37:10 +00:00
Alexis La Goutte a9aba9408b GTK: fix no previous prototype for ... [-Wmissing-prototypes]
Add by commit g43f09e67b (Remove unneeded includes from ui folder)

Change-Id: I7c9d9e2bbd76d062f96422c74ee8eb8c6ecd328b
Reviewed-on: https://code.wireshark.org/review/6808
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-27 12:35:39 +00:00
Evan Huus ee320ef1bf qt: clear tree and bytes when no packet selected
Otherwise trying to interact with them will cause all sorts of funny crashes.

There's probably a better way to trigger these (having the widgets register for
a signal, and sending that signal, or something something something) but this
works and I don't feel like reading 20 pages of Qt documentation right this
instant.

Change-Id: Ic52806ae5ba8d7776f835695590559b8c705d083
Ping-Bug: 10896
Reviewed-on: https://code.wireshark.org/review/6803
Reviewed-by: Evan Huus <eapache@gmail.com>
2015-01-27 03:38:13 +00:00
Gerald Combs 21dfda65d7 Qt: Remove windowIcon property from our .ui files.
Setting the windowIcon property in foo.ui means we end up with a
setWindowIcon call in ui_foo.h. Along with setting the window title
bar icon, it also sets the taskbar icon on Windows. A 16x16 PNG gives
us a jaggy taskbar icon. (Windows ICO format is supported via a plugin
which might not be available everywhere, otherwise we could try using
a .ico resource.)

Move the setWindowIcon call from ge990d1b to the top of the MainWindow
constructor and enable it everywhere.

Change-Id: I4e9765200bb3676c4faa8e0ab1505ce02fb64870
Reviewed-on: https://code.wireshark.org/review/6762
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-01-23 19:15:29 +00:00
Gerald Combs e990d1b2e8 Try to fix the jaggy taskbar icon.
Possibly related to https://bugreports.qt.io/browse/QTBUG-19441.

Change-Id: Idf7ff8a247f459ce465907760ca0ebeaff2cffa8
Reviewed-on: https://code.wireshark.org/review/6746
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-23 12:14:58 +00:00
AndersBroman ae92cd48a9 [Qt] Run windeployqt for Qt versions greater than 5.2
Change-Id: I3c7e7ed35ffead280c1ac394a4ef8172a89fe3a6
Reviewed-on: https://code.wireshark.org/review/6622
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-01-18 22:49:59 +00:00
Guy Harris 050bc7d100 Update some comments to reflect reality.
Get rid of references to ep_ and se_ allocation in code that now uses
wmem allocation instead.

Fix API documentation of conversation_table.h routines to reflect that
as well - some APIs changed to pass wmem scopes.

Also, zbee_sec_key_hash() now takes the output buffer as an argument and
just returns it, and nobody actually uses the return value, so change it
to return void.

Change-Id: Ife1ec675a9322fd0f0be306a9d639ec17aad1c7a
Reviewed-on: https://code.wireshark.org/review/6636
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-18 21:02:40 +00:00
Guy Harris e601e01ffd Remove some apparently-unnecessary includes of emem.h.
Also update a comment to no longer speak of ep_ allocation, and add an
include of <glib.h> to ui/profile.c, which was formerly relying on the
include of emem.h to drag it in.

Change-Id: I08926699ee96cf66672836b6ee3bbb405b507ce8
Reviewed-on: https://code.wireshark.org/review/6633
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-18 19:47:20 +00:00
Guy Harris c7500dd46a Fix another dfilter_compile() call.
Change-Id: I8b035a09b1bc1981a78a80e0a2547dce65a2ac9c
Reviewed-on: https://code.wireshark.org/review/6609
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-18 10:44:27 +00:00
Guy Harris cfcbb28671 Clean up ftype-conversion and dfilter error message string handling.
Have dfilter_compile() take an additional gchar ** argument, pointing to
a gchar * item that, on error, gets set to point to a g_malloc()ed error
string.  That removes one bit of global state from the display filter
parser, and doesn't impose a fixed limit on the error message strings.

Have fvalue_from_string() and fvalue_from_unparsed() take a gchar **
argument, pointer to a gchar * item, rather than an error-reporting
function, and set the gchar * item to point to a g_malloc()ed error
string on an error.

Allow either gchar ** argument to be null; if the argument is null, no
error message is allocated or provided.

Change-Id: Ibd36b8aaa9bf4234aa6efa1e7fb95f7037493b4c
Reviewed-on: https://code.wireshark.org/review/6608
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-18 10:22:59 +00:00
Michael Mann a1f2342e13 Miscellaneous ep_strdup_printf replacement.
Change-Id: I973c672e9d573ad67e9b9fd82a5610aaf8a74efa
Reviewed-on: https://code.wireshark.org/review/6605
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-18 04:15:18 +00:00
Michael Mann 403be722ce Remove emem from GeoIP
Change-Id: Ifa96dc38a277b86c28f762489251dcc595afae67
Reviewed-on: https://code.wireshark.org/review/6603
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-18 04:14:03 +00:00
Michael Mann 77dac91eb0 A few more emem replacements with wmem.
Change-Id: Icfb319fba937642db637a7f26b5e7627461df3b0
Reviewed-on: https://code.wireshark.org/review/6590
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-17 21:05:58 +00:00
Michael Mann 5c5b3f7d26 Convert proto_construct_match_selected_string to use wmem.
Change-Id: I7a40c0996517aa71b4ddb764ce3a6e92a55260ad
Reviewed-on: https://code.wireshark.org/review/6589
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-17 21:04:22 +00:00
Michael Mann 531df02736 Remove se_ alloced memory from packet_list_store
Change-Id: I7aa2f5f8b433468ad2c2cd73cfce986d128a9ae0
Reviewed-on: https://code.wireshark.org/review/6565
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-16 16:03:58 +00:00
Michael Mann ada1eec702 SE_COPY_ADDRESS -> WMEM_COPY_ADDRESS
Copy addresses with wmem-scope instead of (forced) seasonal scope.  All existing instances were converted to wmem_file_scope, but the flexibility is there for other scopes.

Change-Id: I8e58837b9ef574ec7dd87e278470d7063ae8c1c2
Reviewed-on: https://code.wireshark.org/review/6564
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-16 15:25:18 +00:00
Michael Mann e530c89940 Replace se alloced memory in compare stat tap.
Also replaced comments mentioning se_alloc memory with wmem_file_scope, since it's more accurate.

It seems that many of the TShark stat taps may be leaking memory, because the hash tables created by the taps don't get a chance to be freed.  Somewhat academic since TShark exits shortly after displaying any stats, but a leak none the less.

Change-Id: I8ceecbd00d65b3442dc02d720b39c2e15aa0c8a6
Reviewed-on: https://code.wireshark.org/review/6557
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-16 00:37:02 +00:00
Deon van der Westhuysen 7d43836b3a QT: stats_tree plug-ins not added to statistics menu
Wireshark Qt does not add plug-ins that register with stats_tree_register_plugin() to the statistics menu in the ui (like the gtk version does).

This patch dynamically adds all registered stats_tree plug-ins to the statistics menu.

Bug: 9528
Change-Id: I99f9415502ca9f7121d494c856861edc1a762079
Signed-off-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-on: https://code.wireshark.org/review/6336
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-01-16 00:27:35 +00:00
Michael Mann d5ee022b9e Replace C++ style comment with C style.
Change-Id: Ibee0dccdb5a330866dcd0047216cd5a4da45fc8b
Reviewed-on: https://code.wireshark.org/review/6559
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-15 20:10:52 +00:00
Alexis La Goutte 1562827a80 Packet List (Qt): Missing break in switch (CID 1262418)
Change-Id: Id46f2be5b5206dfcb0ce7e7ea2d31398eff54917
Reviewed-on: https://code.wireshark.org/review/6552
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-01-15 18:56:39 +00:00
Jeff Morriss 6f630c10a5 Fix the compile: Use the new (double) variable.
Change-Id: I38a9b0f55e9f19fe7f4f09f5eec2817dd822c6d0
Reviewed-on: https://code.wireshark.org/review/6542
Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2015-01-15 02:05:43 +00:00
Gerald Combs b63a942c4b Fix a crash in the GTK+ RTP Streams dialog.
Make sure we copy guint, gdouble, and gchar * data to variables of the
correct type. Fixes a crash when trying to copy CSV data (we were trying
to stuff a gdouble into a char *).

Change-Id: I3cbcc48216a078f85f13860d14707f309b9820d7
Reviewed-on: https://code.wireshark.org/review/6541
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-01-15 00:59:02 +00:00
Gerald Combs d443db06cc Fix indentation.
Change-Id: I089d18d6dde56c04d75f7c991511728a0a66f699
Reviewed-on: https://code.wireshark.org/review/6540
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-01-15 00:43:07 +00:00
Guy Harris 63a3d043e3 Consistently use the "g_string_free returns a C string pointer" idiom.
g_string_free(str, FALSE) frees the GString container but not the
underlying g_malloc()ed string; instead, it returns a pointer to the
g_malloc()ed string.

Fix those places that didn't already get the string pointer from
g_string_free() to do so rather than manually extracting the string
themselves.

And fix one place that didn't even need to use a string - it was just
scanning a C string without even modifying it.

Change-Id: Ibbf4872bf5b9935b9907f539b6edb1013f3053a5
Reviewed-on: https://code.wireshark.org/review/6532
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-13 23:14:13 +00:00
Guy Harris 9f5e4fb7a5 uat_load() and uat_save() return a success indication; use it.
Instead of always ignoring the return value, always check it, and only
report an error if it returns FALSE.

(Alternative: have it return NULL on success and a pointer to a
g_malloc()ed string on failure.)

Fix a comment while we're at it.

Change-Id: Icb72c9f47775b6552e3eb4fe5ddcc85482bfb5fb
Reviewed-on: https://code.wireshark.org/review/6528
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-13 21:01:28 +00:00
Guy Harris bc23f79729 UAT error string pointers should not be const pointers.
UAT error strings are usually allocated by g_strdup() or
g_strdup_printf(), and must ultimately be freed by the caller.

Make the pointer-to-error-string-pointer arguments to various functions
be "char **", not "const char **".

Fix cases that finds where a raw string was being used, as that won't
work if you try to free it; g_strdup() it instead.

Add a missing free of an error string.

Remove some no-longer-necessary casts.

Remove some unnecessary g_strdup()s (the string being handed to it was
already g_malloc()ated).

Change some variable declarations to match.

Put in XXX comments for some cases where the error string is just freed,
without being shown to the user.

Change-Id: I40297746a2ef729c56763baeddbb0842386fa0d0
Reviewed-on: https://code.wireshark.org/review/6525
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-13 20:20:03 +00:00
Michael Mann 7967ef9510 Remove emem APIs from UAT functionality.
Change-Id: I009c09f25d170e5c9aaaef713eaacb3252817856
Reviewed-on: https://code.wireshark.org/review/6460
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Evan Huus <eapache@gmail.com>
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-12 14:25:12 +00:00
Guy Harris 4a0ec75e4d Use the GTK+ 2 name for VoidSymbol.
We can use the GTK+ 2 GDK_xxx names with GTK+ 2 or 3; apparently, some
versions of GTK+ 2 don't support the GDK_KEY_xxx names.

Change-Id: I52b14a7f2273f2af2b914c3646eb33d21673057e
Reviewed-on: https://code.wireshark.org/review/6498
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-11 21:20:11 +00:00
Peter Wu 74b20dca8c gtk: fix crash on Broadway GDK backend
The Broadway GDK backend does never sets event->string. This results in
a crash when filter_string_te_key_pressed_cb tries to read its contents.

Since the documentation marks reading the string as deprecated, try to
handle the character conversion here. It is based on
_gdk_x11_event_translate_keyboard_string (from gtk+), but without trying
to interpret Escape as '\033', and without trying to convert control
characters (example: Ctrl + 1). A buffer of 6 bytes is used to hold a
UTF-8 code point (there is no zero terminator, so 7 bytes as found in
the original implementation is unnecessary).

As g_locale_from_utf8 returns dynamically allocated memory, change the
control flow to have a single exit point where pointers are freed as
needed.

Reproduce with gtk3:
$ broadwayd :5
$ GDK_BACKEND=broadway BROADWAY_DISPLAY=:5 wireshark-gtk
(now open http://localhost:8085/ and start typing in the display filter)

Keys tested: e € (AltGr + 5) ü (AltGr + ", u)
In the X11 backend, these still get displayed correctly. In the broadway
backend however, the accents are missing due to a bug in the broadway
implementation.

Change-Id: Ic1f0ee2b87cd573023ee8e966f06489b3b744dcf
Reviewed-on: https://code.wireshark.org/review/5832
Reviewed-by: Balint Reczey <balint@balintreczey.hu>
2015-01-11 17:45:48 +00:00
Michael Mann f5c4d06dba Replace some "low hanging fruit" uses of emem.
Most of the remaining ep_ uses are grouped with specific functionality.

Change-Id: I8fa64a17acc6bcdcf6891b2d28715ac0c58f1a4a
Reviewed-on: https://code.wireshark.org/review/6484
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-11 00:27:57 +00:00
Michael Mann 14cad60f7d Remove ep_ allocated memory from get_conversation_filter and just return a g_alloced string.
Change-Id: Ie7f6b2c5479fec1a44afb5e446ef6abf304113af
Reviewed-on: https://code.wireshark.org/review/6480
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-10 19:58:21 +00:00
Michael Mann 5fe1f66176 Finish off emem_strbuf_t usage.
Change-Id: Ib0b911c86a7f8a7cca022e9e324c910664ce397e
Reviewed-on: https://code.wireshark.org/review/6461
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-10 04:20:27 +00:00