]> granicus.if.org Git - php/commitdiff
Fix possible int overflow on vars used in loop with size_t counter
authorAnatol Belski <ab@php.net>
Sun, 18 Feb 2018 15:07:37 +0000 (16:07 +0100)
committerAnatol Belski <ab@php.net>
Sun, 18 Feb 2018 16:55:50 +0000 (17:55 +0100)
ext/standard/base64.c

index 89411533aa72de587bfde082fc7e0e30c1758c96..29268c6766055a61c315d6a452211be12ea0ad1a 100644 (file)
@@ -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) {