summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/standard/math.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/standard/math.c b/ext/standard/math.c
index 8285edeeda..ed367823ed 100644
--- a/ext/standard/math.c
+++ b/ext/standard/math.c
@@ -929,9 +929,10 @@ PHPAPI zend_string * _php_math_longtobase(zval *arg, int base)
*ptr = '\0';
do {
+ ZEND_ASSERT(ptr > buf);
*--ptr = digits[value % base];
value /= base;
- } while (ptr > buf && value);
+ } while (value);
return zend_string_init(ptr, end - ptr, 0);
}