diff options
| author | Thomas Holder <thomas@thomas-holder.de> | 2019-11-21 10:54:11 +0000 |
|---|---|---|
| committer | Thomas Holder <thomas@thomas-holder.de> | 2019-11-21 11:10:29 +0000 |
| commit | 07da321da230c2764da3f2cb12e2648cf1f7df02 (patch) | |
| tree | 9bc7fa763516d8f898085c2dd0b3efe46ec00d49 /src | |
| parent | fix PNG export dialog crash (heap-use-after-free) (diff) | |
| download | inkscape-07da321da230c2764da3f2cb12e2648cf1f7df02.tar.gz inkscape-07da321da230c2764da3f2cb12e2648cf1f7df02.zip | |
fix Glib::Regex::match stack-use-after-scope
Fixes cursor jumping mentioned by @nathanal:
https://gitlab.com/inkscape/inkscape/issues/521#note_247899536
Diffstat (limited to 'src')
| -rw-r--r-- | src/object/sp-text.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/object/sp-text.cpp b/src/object/sp-text.cpp index 714ebe1d2..79f60c7a8 100644 --- a/src/object/sp-text.cpp +++ b/src/object/sp-text.cpp @@ -1051,7 +1051,12 @@ std::vector<Glib::ustring> SPText::get_shapes() const if (style->shape_inside.set && (val = style->shape_inside.value())) { static Glib::RefPtr<Glib::Regex> regex = Glib::Regex::create("url\\(#([A-z0-9#]*)\\)"); Glib::MatchInfo matchInfo; - regex->match(val, matchInfo); + + // Glib::Regex::match stack-use-after-scope workaround + // https://gitlab.gnome.org/GNOME/glibmm/issues/66 + Glib::ustring val_stack = val; + + regex->match(val_stack, matchInfo); while (matchInfo.matches()) { shapes.push_back(matchInfo.fetch(1)); |
