summaryrefslogtreecommitdiffstats
path: root/src/extension/prefdialog.cpp
diff options
context:
space:
mode:
authorBryce Harrington <bryce@bryceharrington.org>2014-09-14 23:03:29 +0000
committerbryce <bryce@ubuntu.com>2014-09-14 23:03:29 +0000
commit70f0a1b307456191c5f2ce103d3edbf4ca23d514 (patch)
treefff9aec49679a4fa44b908f901080c0ebaf7e0dd /src/extension/prefdialog.cpp
parentFix GTK3 build (diff)
downloadinkscape-70f0a1b307456191c5f2ce103d3edbf4ca23d514.tar.gz
inkscape-70f0a1b307456191c5f2ce103d3edbf4ca23d514.zip
Always check result of sp_repr_read_mem for NULL
In cases where undefined or invalid XML is passed to sp_repr_read_mem(), it will indicate failure by returning NULL. All callers must check for this and handle the error condition accordingly. Fixes: lp: #1170248 Fixed bugs: - https://launchpad.net/bugs/1170248 (bzr r13556)
Diffstat (limited to 'src/extension/prefdialog.cpp')
-rw-r--r--src/extension/prefdialog.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/extension/prefdialog.cpp b/src/extension/prefdialog.cpp
index d1f83701f..3a384257c 100644
--- a/src/extension/prefdialog.cpp
+++ b/src/extension/prefdialog.cpp
@@ -90,6 +90,10 @@ PrefDialog::PrefDialog (Glib::ustring name, gchar const * help, Gtk::Widget * co
if (_effect != NULL && !_effect->no_live_preview) {
if (_param_preview == NULL) {
XML::Document * doc = sp_repr_read_mem(live_param_xml, strlen(live_param_xml), NULL);
+ if (doc == NULL) {
+ std::cout << "Error encountered loading live parameter XML !!!" << std::endl;
+ return;
+ }
_param_preview = Parameter::make(doc->root(), _effect);
}