From 39f6874d13d281b557428223e8d2a0d5e6f2feb3 Mon Sep 17 00:00:00 2001 From: Jeff Morriss Date: Fri, 3 Dec 2010 22:59:16 +0000 Subject: [PATCH] Fix a problem noticed in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5380#c2 : Don't attempt to use a BASE_CUSTOM field's 'strings' field as a value_string: it's not, it's a pointer to a function. svn path=/trunk/; revision=35115 --- epan/dfilter/semcheck.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/epan/dfilter/semcheck.c b/epan/dfilter/semcheck.c index 45b6f7127c..0b9fdee1de 100644 --- a/epan/dfilter/semcheck.c +++ b/epan/dfilter/semcheck.c @@ -230,6 +230,17 @@ mk_fvalue_from_val_string(header_field_info *hfinfo, char *s) hfinfo->abbrev); return NULL; } + else if (hfinfo->display & BASE_CUSTOM) { + /* If a user wants to match against a custom string, we would + * somehow have to have the integer value here to pass it in + * to the custom-display function. But we don't have an + * integer, we have the string they're trying to match. + * -><- + */ + dfilter_fail("\"%s\" cannot accept [custom] strings as values.", + hfinfo->abbrev); + return NULL; + } else { const value_string *vals = hfinfo->strings; if (hfinfo->display & BASE_EXT_STRING)