]> granicus.if.org Git - php/commitdiff
Preventing possible segfault
authorBob Weinand <bobwei9@hotmail.com>
Sun, 15 Dec 2013 14:15:34 +0000 (09:15 -0500)
committerBob Weinand <bobwei9@hotmail.com>
Sun, 15 Dec 2013 14:15:34 +0000 (09:15 -0500)
phpdbg_btree.c

index f47422f4630172dade879086c011c256658bcab0..21f3fedcbb1ddcc1634beea4f67b96890d0539ce 100644 (file)
@@ -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]) {