[libdazzle] tree: fix possible NULL dereference



commit 3755a576d22482638556ef7a095ca508dfaf8478
Author: Christian Hergert <chergert redhat com>
Date:   Sat Dec 9 00:51:43 2017 -0800

    tree: fix possible NULL dereference

 src/tree/dzl-tree.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/tree/dzl-tree.c b/src/tree/dzl-tree.c
index 35f890c..4231728 100644
--- a/src/tree/dzl-tree.c
+++ b/src/tree/dzl-tree.c
@@ -927,11 +927,14 @@ _dzl_tree_get_drop_node (DzlTree             *self,
   g_autoptr(DzlTreeNode) node = NULL;
   GtkTreeModel *model;
   GtkTreeIter iter;
+  DzlTreeDropPosition dummy_pos;
 
   g_return_val_if_fail (DZL_IS_TREE (self), NULL);
 
-  if (pos != NULL)
-    *pos = 0;
+  if (pos == NULL)
+    pos = &dummy_pos;
+
+  *pos = 0;
 
   /* We can't do anything if we don't have a path */
   if (priv->last_drop_path == NULL)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]