From a7b0dfb7b12cdfb6cd78e5f1c686094d7a567555 Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Sun, 15 Dec 2013 09:15:34 -0500 Subject: [PATCH] Preventing possible segfault --- phpdbg_btree.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phpdbg_btree.c b/phpdbg_btree.c index f47422f463..21f3fedcbb 100644 --- a/phpdbg_btree.c +++ b/phpdbg_btree.c @@ -34,6 +34,10 @@ phpdbg_btree_result *phpdbg_btree_find(phpdbg_btree *tree, zend_ulong idx) { phpdbg_btree_branch *branch = tree->branch; int i = tree->depth - 1; + if (branch == NULL) { + return NULL; + } + do { if ((idx >> i) % 2 == 1) { if (branch->branches[1]) { -- 2.50.1