From 70f0a1b307456191c5f2ce103d3edbf4ca23d514 Mon Sep 17 00:00:00 2001 From: Bryce Harrington Date: Sun, 14 Sep 2014 16:03:29 -0700 Subject: 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) --- src/inkscape.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/inkscape.cpp') diff --git a/src/inkscape.cpp b/src/inkscape.cpp index 4b4c8c678..e312e15b9 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -945,7 +945,7 @@ bool inkscape_load_menus( Inkscape::Application * inkscape ) inkscape->menus = sp_repr_read_mem(menus_skeleton, MENUS_SKELETON_SIZE, NULL); } - return (inkscape->menus != 0); + return (inkscape->menus != NULL); } -- cgit v1.2.3