aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/manage_interfaces_dialog.cpp
diff options
context:
space:
mode:
authorJoerg Mayer <jmayer@loplof.de>2017-03-26 19:11:02 +0200
committerJörg Mayer <jmayer@loplof.de>2017-03-29 20:12:58 +0000
commit57d15713db46be0a48a29b4201aea976c20fb3e9 (patch)
tree5df70172ec4bb6c371e47a777e342872cf89ccd0 /ui/qt/manage_interfaces_dialog.cpp
parenta2cf38305e6ead954cb91d4cfdb1968281bd7bbe (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/qt/manage_interfaces_dialog.cpp')
-rw-r--r--ui/qt/manage_interfaces_dialog.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/ui/qt/manage_interfaces_dialog.cpp b/ui/qt/manage_interfaces_dialog.cpp
index e277f980fc..fc6eadd1ea 100644
--- a/ui/qt/manage_interfaces_dialog.cpp
+++ b/ui/qt/manage_interfaces_dialog.cpp
@@ -308,6 +308,7 @@ void ManageInterfacesDialog::updateRemoteInterfaceList(GList* rlist, remote_opti
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);