summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Holder <thomas@thomas-holder.de>2019-11-20 13:26:06 +0000
committerThomas Holder <thomas@thomas-holder.de>2019-11-20 20:50:49 +0000
commit6acb5933067c98c1b3a6bce5b27596f4536762c6 (patch)
treecc7ca377b9b4bd680153e474f0716c8ee0a5102c
parentFix build (diff)
downloadinkscape-6acb5933067c98c1b3a6bce5b27596f4536762c6.tar.gz
inkscape-6acb5933067c98c1b3a6bce5b27596f4536762c6.zip
fix PNG export dialog crash (heap-use-after-free)
Possibly related to inbox#1185
-rw-r--r--src/ui/dialog/export.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp
index 7b2f2628d..d684a2693 100644
--- a/src/ui/dialog/export.cpp
+++ b/src/ui/dialog/export.cpp
@@ -452,11 +452,11 @@ void Export::set_default_filename () {
{
SPDocument * doc = SP_ACTIVE_DOCUMENT;
const gchar *uri = doc->getDocumentURI();
- const gchar *text_extension = get_file_save_extension (Inkscape::Extension::FILE_SAVE_METHOD_SAVE_AS).c_str();
+ auto &&text_extension = get_file_save_extension(Inkscape::Extension::FILE_SAVE_METHOD_SAVE_AS);
Inkscape::Extension::Output * oextension = nullptr;
- if (text_extension != nullptr) {
- oextension = dynamic_cast<Inkscape::Extension::Output *>(Inkscape::Extension::db.get(text_extension));
+ if (!text_extension.empty()) {
+ oextension = dynamic_cast<Inkscape::Extension::Output *>(Inkscape::Extension::db.get(text_extension.c_str()));
}
if (oextension != nullptr) {