]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-5.6'
authorStanislav Malyshev <stas@php.net>
Tue, 2 Jun 2015 05:55:16 +0000 (22:55 -0700)
committerStanislav Malyshev <stas@php.net>
Tue, 2 Jun 2015 05:55:16 +0000 (22:55 -0700)
* PHP-5.6:
  Fix bug #69737 - Segfault when SplMinHeap::compare produces fatal error

Conflicts:
ext/spl/spl_heap.c

1  2 
ext/spl/spl_heap.c

index a92707bd932a59d6f91215d571ce59644417b261,3ff503a2a9ae2c01eec2e79b45b6f3a582607038..c4857663e76d0d50ca6f7c315e642fd7e7ff061c
@@@ -248,10 -246,13 +248,11 @@@ static void spl_ptr_heap_insert(spl_ptr
                heap->max_size *= 2;
        }
  
 -      heap->ctor(elem TSRMLS_CC);
 -
        /* sifting up */
-       for (i = heap->count++; i > 0 && heap->cmp(&heap->elements[(i-1)/2], elem, cmp_userdata) < 0; i = (i-1)/2) {
 -      for(i = heap->count; i > 0 && heap->cmp(heap->elements[(i-1)/2], elem, cmp_userdata TSRMLS_CC) < 0; i = (i-1)/2) {
++      for (i = heap->count; i > 0 && heap->cmp(&heap->elements[(i-1)/2], elem, cmp_userdata) < 0; i = (i-1)/2) {
                heap->elements[i] = heap->elements[(i-1)/2];
        }
+       heap->count++;
  
        if (EG(exception)) {
                /* exception thrown during comparison */