cvs: php4 /main rfc1867.c
| From: | Stefan Esser | Date: | Thu, 14 Nov 2002 16:30:08 +0000 |
| Subject: | cvs: php4 /main rfc1867.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-16160@lists.php.net to get a copy of this message | ||
sesser Thu Nov 14 11:30:08 2002 EDT
Modified files:
/php4/main rfc1867.c
Log:
Fixing possible remote overflow due to mbstring translation.
Index: php4/main/rfc1867.c
diff -u php4/main/rfc1867.c:1.122 php4/main/rfc1867.c:1.123
--- php4/main/rfc1867.c:1.122 Wed Oct 23 22:59:01 2002
+++ php4/main/rfc1867.c Thu Nov 14 11:30:07 2002
@@ -16,7 +16,7 @@
| Jani Taskinen <sniper@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: rfc1867.c,v 1.122 2002/10/24 02:59:01 moriyoshi Exp $ */
+/* $Id: rfc1867.c,v 1.123 2002/11/14 16:30:07 sesser Exp $ */
/*
* This product includes software developed by the Apache Group
@@ -513,7 +513,7 @@
#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;