Wireshark-commits: [Wireshark-commits] master 57d1571: Prevent crash/assert on access to "uninitial
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=57d15713db46be0a48a29b4201aea976c20fb3e9
Submitter: Jörg Mayer (jmayer@xxxxxxxxx)
Changed: branch: master
Repository: wireshark
Commits:
57d1571 by Joerg Mayer (jmayer@xxxxxxxxx):
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@xxxxxxxxx>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@xxxxxxxxxxxxx>
Reviewed-by: Jörg Mayer <jmayer@xxxxxxxxx>
Actions performed:
from a2cf383 c15ch: fix value_string termination
adds 57d1571 Prevent crash/assert on access to "uninitialized" device.if_info.name.
Summary of changes:
ui/gtk/capture_dlg.c | 1 +
ui/qt/manage_interfaces_dialog.cpp | 1 +
2 files changed, 2 insertions(+)