Skip to content

regex: Set error if compile or match flags are invalid

This avoids segfaults in applications when they try dereferencing the passed in GError to learn more about why regex compilation failed.

For example consider the following pattern:

re = g_regex_new (..., &error); if (!re) g_warning ("Error compiling regex: %s", err->message);

Caused a segfault in phosh World/Phosh/phosh#843 (closed) which used the (now) deprecated G_REGEX_JAVASCRIPT_COMPAT

Merge request reports