summaryrefslogtreecommitdiff
path: root/debian/patches/0017-Fix-a-potential-NULL-dereference-in-tree-code.patch
blob: dd8ee342087afa26d4a7056cf7889cd2535b3ff0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
From: Daniel Veillard <veillard@redhat.com>
Date: Wed, 11 Sep 2013 15:11:27 +0800
Subject: Fix a potential NULL dereference in tree code

https://bugzilla.gnome.org/show_bug.cgi?id=707750

Also reported by Gaurav, simple fix to check the pointer before
dereference
---
 tree.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tree.c b/tree.c
index 7e5af26..efc3ca2 100644
--- a/tree.c
+++ b/tree.c
@@ -9780,7 +9780,8 @@ leave_node:
 	    if (clone->parent != NULL)
 		clone->parent->last = clone;
 	    clone = clone->parent;
-	    parentClone = clone->parent;
+	    if (clone != NULL)
+		parentClone = clone->parent;
 	    /*
 	    * Process parent --> next;
 	    */