summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorOndrej Holy <oholy@redhat.com>2018-10-26 14:45:43 +0200
committerOndrej Holy <oholy@redhat.com>2018-10-26 15:19:35 +0200
commita23eb6f14eb3cffa1585d4e5e566f779337d1e04 (patch)
tree00dc3b48c76506dd064174239c078d661a20697a /common
parentb62bfa7448b108d3b93f5b27d866d2120b782d39 (diff)
downloadgvfs-a23eb6f14eb3cffa1585d4e5e566f779337d1e04.tar.gz
common: Prevent crashes on invalid autorun file
GRegex expects valid UTF-8 input by default and libpcre may crash if it is not valid. GRegex is used to parse autorun file, which doesn't have to be always valid. Let's use G_REGEX_RAW to prevent the crashes. Closes: https://gitlab.gnome.org/GNOME/gvfs/issues/344
Diffstat (limited to 'common')
-rw-r--r--common/gvfsmountinfo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/gvfsmountinfo.c b/common/gvfsmountinfo.c
index 3b191892..c3f31afd 100644
--- a/common/gvfsmountinfo.c
+++ b/common/gvfsmountinfo.c
@@ -107,7 +107,7 @@ on_autorun_loaded (GObject *source_object,
* has a comma at the end
**/
icon_regex = g_regex_new ("icon\\s*=\\s*+([^,\\r\\n]+)",
- G_REGEX_CASELESS, 0, NULL);
+ G_REGEX_CASELESS | G_REGEX_RAW, 0, NULL);
g_regex_match (icon_regex, content, 0,
&match_info);