aboutsummaryrefslogtreecommitdiffstats
path: root/sharkd.c
diff options
context:
space:
mode:
authorJakub Zawadzki <darkjames-ws@darkjames.pl>2018-09-01 18:47:38 +0200
committerMichal Labedzki <michal.labedzki@wireshark.org>2018-09-02 11:23:30 +0000
commit3ce847e39e4b5a51f4163459e6206b62049f8930 (patch)
treed85815032cc76e8542a31443f5b0d22a24ae55bb /sharkd.c
parent8f99b54a77c8747b310ebbc00cdbb51d4035cb99 (diff)
sharkd: Fix frames request for empty "" filter
For empty filters dfilter_compile() return success but with NULL dfcode, still if used dfilter_prime_proto_tree() crashed cause of NULL df pointer. Change-Id: I0684abf8ef766a24d0c8150fef4e113813c490ea Reviewed-on: https://code.wireshark.org/review/29390 Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl> Tested-by: Petri Dish Buildbot Reviewed-by: Michal Labedzki <michal.labedzki@wireshark.org> Tested-by: Michal Labedzki <michal.labedzki@wireshark.org>
Diffstat (limited to 'sharkd.c')
-rw-r--r--sharkd.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sharkd.c b/sharkd.c
index 28d53cd12b..66fd41b8f1 100644
--- a/sharkd.c
+++ b/sharkd.c
@@ -726,6 +726,12 @@ sharkd_filter(const char *dftext, guint8 **result)
return -1;
}
+ /* if dfilter_compile() success, but (dfcode == NULL) all frames are matching */
+ if (dfcode == NULL) {
+ *result = NULL;
+ return 0;
+ }
+
frames_count = cfile.count;
wtap_rec_init(&rec);