diff options
author | Mikael Kanstrup <mikael.kanstrup@gmail.com> | 2018-01-08 20:02:08 +0100 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2018-01-08 20:57:54 +0000 |
commit | bde402840f9930e8930d2f31ce19229e00496954 (patch) | |
tree | f6f279ba1e4e9bbf1bbc508cc6b7be6db38d2298 /extcap | |
parent | 0655931f606efc086e8526c7f4a687ac6477686e (diff) |
androiddump: Fix crash in add_tcpdump_interfaces
If there's a network interface on the device without the 'flags'
field and at the same time exist other network interfaces
with the 'flags' field present a null-dereference happens accessing
the non-matched regex flags field.
Fix crash by adding explicit null check to ensure (optional) regex
group really matched.
Fixes: 7dcf57719f ("androiddump: Support older on-target tcpdump versions")
Change-Id: Ia08dd8547c9cdda96b3c62b99d98ff1d85bd6cd2
Reviewed-on: https://code.wireshark.org/review/25198
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'extcap')
-rw-r--r-- | extcap/androiddump.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/extcap/androiddump.c b/extcap/androiddump.c index e7033de3c1..dd5617d081 100644 --- a/extcap/androiddump.c +++ b/extcap/androiddump.c @@ -929,7 +929,7 @@ static int add_tcpdump_interfaces(extcap_parameters * extcap_conf, const char *a gchar *iface = g_match_info_fetch_named(match, "iface"); gchar *flags = g_match_info_fetch_named(match, "flags"); - if (!flags_supported || strstr(flags, "Up")) { + if (!flags_supported || (flags && strstr(flags, "Up"))) { g_snprintf(iface_name, sizeof(iface_name), INTERFACE_ANDROID_TCPDUMP_FORMAT, iface); new_interface(extcap_conf, iface_name, iface, serial_number, "Android tcpdump"); } |