File php5-wrong-fail-stack_push.patch of Package php5.openSUSE_13.1_Update

Index: Zend/zend_stack.c
===================================================================
--- Zend/zend_stack.c.orig	2014-12-17 10:39:40.000000000 +0100
+++ Zend/zend_stack.c	2015-01-07 15:13:38.258091022 +0100
@@ -34,10 +34,11 @@
 {
 	if (stack->top >= stack->max) {		/* we need to allocate more memory */
 		stack->elements = (void **) erealloc(stack->elements,
-				   (sizeof(void **) * (stack->max += STACK_BLOCK_SIZE)));
+				   (sizeof(void **) * (stack->max + STACK_BLOCK_SIZE)));
 		if (!stack->elements) {
 			return FAILURE;
 		}
+		stack->max += STACK_BLOCK_SIZE; 
 	}
 	stack->elements[stack->top] = (void *) emalloc(size);
 	memcpy(stack->elements[stack->top], element, size);
openSUSE Build Service is sponsored by