[gnome-shell] st: Add missing %NULL check
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] st: Add missing %NULL check
- Date: Wed, 22 Mar 2017 17:52:25 +0000 (UTC)
commit b477d215a8119f47dc635498a896701c6a4fd7e7
Author: Florian Müllner <fmuellner gnome org>
Date: Wed Mar 22 01:26:08 2017 +0100
st: Add missing %NULL check
st_theme_node_get_border_image() may return %NULL, leading to a
segfault in st_border_image_get_file() when glib is compiled with
G_DISABLE_CHECKS.
https://bugzilla.gnome.org/show_bug.cgi?id=780381
src/st/st-widget.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/st/st-widget.c b/src/st/st-widget.c
index 002249d..db984ac 100644
--- a/src/st/st-widget.c
+++ b/src/st/st-widget.c
@@ -290,6 +290,7 @@ st_widget_texture_cache_changed (StTextureCache *cache,
StWidget *actor = ST_WIDGET (user_data);
StWidgetPrivate *priv = st_widget_get_instance_private (actor);
StThemeNode *node = priv->theme_node;
+ StBorderImage *border_image;
gboolean changed = FALSE;
GFile *theme_file;
@@ -303,7 +304,8 @@ st_widget_texture_cache_changed (StTextureCache *cache,
changed = TRUE;
}
- theme_file = st_border_image_get_file (st_theme_node_get_border_image (node));
+ border_image = st_theme_node_get_border_image (node);
+ theme_file = border_image ? st_border_image_get_file (border_image) : NULL;
if ((theme_file != NULL) && g_file_equal (theme_file, file))
{
st_theme_node_invalidate_border_image (node);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]