Commit a23eb6f1 authored by Ondrej Holy's avatar Ondrej Holy

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: GNOME/gvfs#344
parent b62bfa74
Pipeline #37590 passed with stage
in 1 minute and 20 seconds
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment