From: Stefan Esser Date: Thu, 14 Nov 2002 16:30:07 +0000 (+0000) Subject: Fixing possible remote overflow due to mbstring translation. X-Git-Tag: BEFORE_RENAMING~41 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=658fd1ba8d985a53300e3f263b8ff6bab1e46686;p=php Fixing possible remote overflow due to mbstring translation. --- diff --git a/main/rfc1867.c b/main/rfc1867.c index 4ce2b07147..f422b7e66c 100644 --- a/main/rfc1867.c +++ b/main/rfc1867.c @@ -513,7 +513,7 @@ static char *substring_conf(char *start, int len, char quote TSRMLS_DC) #if HAVE_MBSTRING && !defined(COMPILE_DL_MBSTRING) if (php_mb_encoding_translation(TSRMLS_C)) { size_t j = php_mb_mbchar_bytes(start+i TSRMLS_CC); - while (j-- > 0) { + while (j-- > 0 && i < len) { *resp++ = start[i++]; } --i;