diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2011-10-28 20:04:48 +0000 |
|---|---|---|
| committer | Johan Engelen <goejendaagh@zonnet.nl> | 2011-10-28 20:04:48 +0000 |
| commit | 1937d8b83734173f61d1a620c7431f7e692ae88f (patch) | |
| tree | 6788d89d66140542a776d3b462cad3f3ea85b00f /src/extension/effect.cpp | |
| parent | fix potential null pointer deref (diff) | |
| download | inkscape-1937d8b83734173f61d1a620c7431f7e692ae88f.tar.gz inkscape-1937d8b83734173f61d1a620c7431f7e692ae88f.zip | |
fix potential null pointer deref
(bzr r10702)
Diffstat (limited to 'src/extension/effect.cpp')
| -rw-r--r-- | src/extension/effect.cpp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/extension/effect.cpp b/src/extension/effect.cpp index b42caca06..4f87e98cd 100644 --- a/src/extension/effect.cpp +++ b/src/extension/effect.cpp @@ -296,18 +296,20 @@ Effect::effect (Inkscape::UI::View::View * doc) void Effect::set_last_effect (Effect * in_effect) { - gchar const * verb_id = in_effect->get_verb()->get_id(); - gchar const * help_id_prefix = "org.inkscape.help."; - - // We don't want these "effects" to register as the last effect, - // this wouldn't be helpful to the user who selects a real effect, - // then goes to the help file (implemented as an effect), then goes - // back to the effect, only to see it written over by the help file - // selection. - - // This snippet should fix this bug: - // https://bugs.launchpad.net/inkscape/+bug/600671 - if (strncmp(verb_id, help_id_prefix, strlen(help_id_prefix)) == 0) return; + if (in_effect) { + gchar const * verb_id = in_effect->get_verb()->get_id(); + gchar const * help_id_prefix = "org.inkscape.help."; + + // We don't want these "effects" to register as the last effect, + // this wouldn't be helpful to the user who selects a real effect, + // then goes to the help file (implemented as an effect), then goes + // back to the effect, only to see it written over by the help file + // selection. + + // This snippet should fix this bug: + // https://bugs.launchpad.net/inkscape/+bug/600671 + if (strncmp(verb_id, help_id_prefix, strlen(help_id_prefix)) == 0) return; + } if (in_effect == NULL) { Inkscape::Verb::get(SP_VERB_EFFECT_LAST)->sensitive(NULL, false); |
