diff options
author | Joerg Mayer <jmayer@loplof.de> | 2017-03-26 19:11:02 +0200 |
---|---|---|
committer | Jörg Mayer <jmayer@loplof.de> | 2017-03-29 20:12:58 +0000 |
commit | 57d15713db46be0a48a29b4201aea976c20fb3e9 (patch) | |
tree | 5df70172ec4bb6c371e47a777e342872cf89ccd0 /ui/gtk | |
parent | a2cf38305e6ead954cb91d4cfdb1968281bd7bbe (diff) |
Prevent crash/assert on access to "uninitialized" device.if_info.name.
While this is one possible way to fix it, it probably is not the "right"
way to do it. I just don't know which one would be right. I regard
several options to be cleaner:
- Remove if_info from interface_t altogether and add the required fields
to interface_t directly.
- Never use device.if_info.name but always use device.name (same with
friendly_name)
- Initialize both fields the same (same with friendly_name)
- Also not nice: device is optically a struct, not a pointer. So into the
function, when we create a new struct (that's where the error "is made"),
the same name continues to be used.
Not improving my confidence into my solution:
- I haven't bee able to figure out why the automated Windows builds don't
crash/assert.
Last but not least: The two qt/gtk functions should probably have their common
core extracted into a common function.
Change-Id: I1b36d1765d1a1ec975927cb5785a1540ba4952f5
Ping-Bug: 13448
Reviewed-on: https://code.wireshark.org/review/20721
Petri-Dish: Jörg Mayer <jmayer@loplof.de>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jörg Mayer <jmayer@loplof.de>
Diffstat (limited to 'ui/gtk')
-rw-r--r-- | ui/gtk/capture_dlg.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ui/gtk/capture_dlg.c b/ui/gtk/capture_dlg.c index d5a96480a8..75f1a76762 100644 --- a/ui/gtk/capture_dlg.c +++ b/ui/gtk/capture_dlg.c @@ -1259,6 +1259,7 @@ insert_new_rows(GList *rlist) ips = 0; memset(&device, 0, sizeof(device)); device.name = g_strdup(if_info->name); + device.if_info.name = g_strdup("Don't crash on bug 13448"); /* Is this interface hidden and, if so, should we include it anyway? */ descr = capture_dev_user_descr_find(if_info->name); |