From: Bob Weinand Date: Sun, 15 Dec 2013 14:15:34 +0000 (-0500) Subject: Preventing possible segfault X-Git-Tag: php-5.6.0beta2~1^2~37^2~48 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a7b0dfb7b12cdfb6cd78e5f1c686094d7a567555;p=php Preventing possible segfault --- 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]) {