summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Kanstrup <mikael.kanstrup@gmail.com>2017-06-30 16:10:12 +0200
committerMichael Mann <mmann78@netscape.net>2017-07-01 01:24:31 +0000
commit91e512985fac3f58986a8fdc322bcaf02f5e3685 (patch)
treedd123e8d88f50d2a01763a5b9441ee3e5fe6864d
parentb3453b9be4bd4deff285a713af4aa929bb9634c4 (diff)
downloadwireshark-91e512985fac3f58986a8fdc322bcaf02f5e3685.tar.gz
androiddump: Fix null dereference if linktype not found
If linktype cannot be determined from tcpdump output the lookup function is handed a NULL which is then strcmp:ed. Handle NULL parameter by explicit check. Fixes Coverity CID 1413923 Change-Id: I290c116991d15cef0a1e954a9f8b76722a5f450c Reviewed-on: https://code.wireshark.org/review/22483 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
-rw-r--r--extcap/androiddump.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/extcap/androiddump.c b/extcap/androiddump.c
index ab145cbf4f..3e65902f6b 100644
--- a/extcap/androiddump.c
+++ b/extcap/androiddump.c
@@ -2311,6 +2311,8 @@ static int linktype_to_extcap_encap(const char* linktype)
int i;
int ret = EXTCAP_ENCAP_ETHERNET;
+ if (!linktype)
+ return ret;
for (i = 0; lookup[i].dlt; i++) {
if (!strcmp(lookup[i].dlt, linktype)) {
ret = lookup[i].extcap_encap;