column: set G_REGEX_RAW for the custom column filter

Neither the pattern nor the intended subject (a custom fields filter)
contain UTF-8, so set G_REGEX_RAW accordingly. While a filter such as
`tcp matches "foo\xff"` (with `\xff` being a single byte) was accepted,
it did not trigger a crash though even if the precondition was violated.

Change-Id: I45d76b9abbd942d186dcf70f581121769bbd2d0a
Ping-Bug: 14905
Reviewed-on: https://code.wireshark.org/review/31940
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
This commit is contained in:
Peter Wu 2019-02-08 18:52:09 +01:00
parent 567fe966b1
commit 720c3bdc04
2 changed files with 4 additions and 2 deletions

View File

@ -67,7 +67,8 @@ col_setup(column_info *cinfo, const gint num_cols)
cinfo->col_last[i] = -1;
}
cinfo->prime_regex = g_regex_new(COL_CUSTOM_PRIME_REGEX,
G_REGEX_ANCHORED, G_REGEX_MATCH_ANCHORED, NULL);
(GRegexCompileFlags) (G_REGEX_ANCHORED | G_REGEX_RAW),
G_REGEX_MATCH_ANCHORED, NULL);
}
static void

View File

@ -785,7 +785,8 @@ get_column_tooltip(const gint col)
}
fields = g_regex_split_simple(COL_CUSTOM_PRIME_REGEX, cfmt->custom_fields,
G_REGEX_ANCHORED, G_REGEX_MATCH_ANCHORED);
(GRegexCompileFlags) (G_REGEX_ANCHORED | G_REGEX_RAW),
G_REGEX_MATCH_ANCHORED);
column_tooltip = g_string_new("");
for (i = 0; i < g_strv_length(fields); i++) {