diff options
author | Mikael Kanstrup <mikael.kanstrup@gmail.com> | 2017-06-30 16:10:12 +0200 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-07-01 01:24:31 +0000 |
commit | 91e512985fac3f58986a8fdc322bcaf02f5e3685 (patch) | |
tree | dd123e8d88f50d2a01763a5b9441ee3e5fe6864d /extcap | |
parent | b3453b9be4bd4deff285a713af4aa929bb9634c4 (diff) |
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>
Diffstat (limited to 'extcap')
-rw-r--r-- | extcap/androiddump.c | 2 |
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; |