From 1bdf7abbcba6d3ddde5e8268b43666848c1d437c Mon Sep 17 00:00:00 2001 From: Anatol Belski Date: Sun, 18 Feb 2018 16:07:37 +0100 Subject: [PATCH] Fix possible int overflow on vars used in loop with size_t counter --- ext/standard/base64.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/standard/base64.c b/ext/standard/base64.c index 89411533aa..29268c6766 100644 --- a/ext/standard/base64.c +++ b/ext/standard/base64.c @@ -89,7 +89,8 @@ static zend_always_inline unsigned char *php_base64_encode_impl(const unsigned c static zend_always_inline int php_base64_decode_impl(const unsigned char *in, size_t inl, unsigned char *out, size_t *outl, zend_bool strict) /* {{{ */ { - int ch, i = 0, padding = 0, j = *outl; + int ch; + size_t i = 0, padding = 0, j = *outl; /* run through the whole string, converting as we go */ while (inl-- > 0) { -- 2.50.1