extcap: fix a crash introduced in g622603b
authorPascal Quantin <pascal.quantin@gmail.com>
Tue, 17 Nov 2015 10:32:01 +0000 (11:32 +0100)
committerPascal Quantin <pascal.quantin@gmail.com>
Tue, 17 Nov 2015 10:37:36 +0000 (10:37 +0000)
When using GTK UI, cfilter is initialized to NULL, not to an empty string.

Change-Id: Ic9f3957d4de551a929578e76d5b9c63936517299
Reviewed-on: https://code.wireshark.org/review/11910
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
extcap.c

index c161e48c39dfbc5cef658970932bb6a791b90861..22fdb7553d191699f5d812f04b202c0e5491c622 100644 (file)
--- a/extcap.c
+++ b/extcap.c
@@ -583,7 +583,7 @@ extcaps_init_initerfaces(capture_options *capture_opts)
         add_arg(EXTCAP_ARGUMENT_RUN_CAPTURE);
         add_arg(EXTCAP_ARGUMENT_INTERFACE);
         add_arg(interface_opts.name);
-        if (strlen(interface_opts.cfilter) > 0) {
+        if (interface_opts.cfilter && strlen(interface_opts.cfilter) > 0) {
             add_arg(EXTCAP_ARGUMENT_CAPTURE_FILTER);
             add_arg(interface_opts.cfilter);
         }