aboutsummaryrefslogtreecommitdiffstats
path: root/extcap/androiddump.c
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2019-02-08 18:48:26 +0100
committerPeter Wu <peter@lekensteyn.nl>2019-02-10 16:12:46 +0000
commit567fe966b1ca9a4c00f9989de9a38cfe8ebfbd14 (patch)
tree414a608bc93e65134e56d7ecb8a8b8420c2f7262 /extcap/androiddump.c
parent80587eb0636e0e8642be504bc9cd207f37122a0b (diff)
downloadwireshark-567fe966b1ca9a4c00f9989de9a38cfe8ebfbd14.tar.gz
wireshark-567fe966b1ca9a4c00f9989de9a38cfe8ebfbd14.tar.bz2
wireshark-567fe966b1ca9a4c00f9989de9a38cfe8ebfbd14.zip
extcap: set G_REGEX_RAW to avoid potential crashes
None of the patterns try to match UTF-8 text. Treat the inputs as bytes to avoid potential crashes on invalid subjects (e.g. malformed data from an extcap binary, ADB or SSH server). Change-Id: I6f3113cfd9da04ae3fa2b0ece7b0a3a94312830e Ping-Bug: 14905 Reviewed-on: https://code.wireshark.org/review/31939 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'extcap/androiddump.c')
-rw-r--r--extcap/androiddump.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/extcap/androiddump.c b/extcap/androiddump.c
index b3fd931c2f..62b37b1d37 100644
--- a/extcap/androiddump.c
+++ b/extcap/androiddump.c
@@ -942,7 +942,7 @@ static int add_tcpdump_interfaces(extcap_parameters * extcap_conf, const char *a
}
response[data_length] = '\0';
- regex = g_regex_new(regex_ifaces, (GRegexCompileFlags)0, (GRegexMatchFlags)0, &err);
+ regex = g_regex_new(regex_ifaces, G_REGEX_RAW, (GRegexMatchFlags)0, &err);
if (!regex) {
g_warning("Failed to compile regex for tcpdump interface matching");
return EXIT_CODE_GENERIC;
@@ -2325,7 +2325,7 @@ static int capture_android_tcpdump(char *interface, char *fifo,
GMatchInfo *match = NULL;
char tcpdump_cmd[80];
- regex = g_regex_new(regex_interface, (GRegexCompileFlags)0, (GRegexMatchFlags)0, &err);
+ regex = g_regex_new(regex_interface, G_REGEX_RAW, (GRegexMatchFlags)0, &err);
if (!regex) {
g_warning("Failed to compile regex for tcpdump interface");
return EXIT_CODE_GENERIC;
@@ -2611,7 +2611,7 @@ int main(int argc, char *argv[]) {
break;
}
- if (g_regex_match_simple("(^|\\s)-[bBcDfgLnpPrv]", optarg, (GRegexCompileFlags)0, (GRegexMatchFlags)0)) {
+ if (g_regex_match_simple("(^|\\s)-[bBcDfgLnpPrv]", optarg, G_REGEX_RAW, (GRegexMatchFlags)0)) {
g_error("Found prohibited option in logcat-custom-options");
return EXIT_CODE_GENERIC;
}