summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2014-02-14 01:45:32 +1100
committerCaolán McNamara <caolanm@redhat.com>2014-02-14 09:06:38 +0000
commit64fe9c6fd5888a7eeed34a20787d2d61da02378f (patch)
tree58b1d2dfc79c61e501230f39d8f0109fc13c24c9
parentf8a8bbf303fc77db354f61b77d11e44671b48ed8 (diff)
fdo#74931 Prevent UpdateSettings from dereferencing null pointer
When calling on GtkSalFrame::GetGraphics(), if all graphics are in use then it will return NULL. We don't currently check for this, but we still try to use the graphics object even if none are available. I have added a warning when this occurs and just return immediately, as there's nothing more we can do. Change-Id: I24dfbb6f37f41527078a60a7577cb3b20de3fcca Reviewed-on: https://gerrit.libreoffice.org/8031 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--vcl/unx/gtk/window/gtksalframe.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index 38ea02318e32..3fb2eb55624f 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -2888,6 +2888,11 @@ void GtkSalFrame::UpdateSettings( AllSettings& rSettings )
if( ! pGraphics )
{
pGraphics = static_cast<GtkSalGraphics*>(GetGraphics());
+ if ( !pGraphics )
+ {
+ SAL_WARN("vcl", "Could not get graphics - unable to update settings");
+ return;
+ }
bFreeGraphics = true;
}