cvs: php-src(PHP_5_2) /ext/standard html.c
| From: | Nuno Lopes | Date: | Sun, 27 May 2007 15:45:18 +0000 |
| Subject: | cvs: php-src(PHP_5_2) /ext/standard html.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-44495@lists.php.net to get a copy of this message | ||
nlopess Sun May 27 15:45:18 2007 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/standard html.c
Log:
fix the new 'no-double-encoding' feature of htmlspecialchars() (the length for char
search was wrong. this could lead to crashes..)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/html.c?r1=1.111.2.2.2.12&r2=1.111.2.2.2.13&diff_format=u
Index: php-src/ext/standard/html.c
diff -u php-src/ext/standard/html.c:1.111.2.2.2.12 php-src/ext/standard/html.c:1.111.2.2.2.13
--- php-src/ext/standard/html.c:1.111.2.2.2.12 Fri May 25 14:09:02 2007
+++ php-src/ext/standard/html.c Sun May 27 15:45:18 2007
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: html.c,v 1.111.2.2.2.12 2007/05/25 14:09:02 bjori Exp $ */
+/* $Id: html.c,v 1.111.2.2.2.13 2007/05/27 15:45:18 nlopess Exp $ */
/*
* HTML entity resources:
@@ -1153,7 +1153,7 @@
memcpy(replaced + len, "&", sizeof("&") - 1);
len += sizeof("&") - 1;
} else {
- char *e = memchr(old + i, ';', len - i);
+ char *e = memchr(old + i, ';', oldlen - i);
char *s = old + i + 1;
if (!e || (e - s) > 10) { /* minor optimization to avoid "entities" over 10 chars
in length */