From da3add26cf7d9eec2023fdd3e52550ccb49aa74c Mon Sep 17 00:00:00 2001 From: Tjerk Meesters Date: Wed, 30 Jul 2014 17:54:09 +0800 Subject: Fixed bug #67693 - incorrect push to the empty array --- ext/standard/array.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ext/standard/array.c') diff --git a/ext/standard/array.c b/ext/standard/array.c index c2efca58fc..06cac0e646 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -2020,7 +2020,7 @@ static void _phpi_pop(INTERNAL_FUNCTION_PARAMETERS, int off_the_end) if (should_rehash) { zend_hash_rehash(Z_ARRVAL_P(stack)); } - } else if (!key_len && index >= Z_ARRVAL_P(stack)->nNextFreeElement - 1) { + } else if (!key_len && Z_ARRVAL_P(stack)->nNextFreeElement > 0 && index >= Z_ARRVAL_P(stack)->nNextFreeElement - 1) { Z_ARRVAL_P(stack)->nNextFreeElement = Z_ARRVAL_P(stack)->nNextFreeElement - 1; } -- cgit v1.2.1