rasmus Thu May 24 20:53:05 2007 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/standard string.c
Log:
Avoid running off the end of a non-null terminated string. Not that we
should have any of those, but a mistake in an extension could hit this
and the check doesn't actually make any sense as far as I am concerned.
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/string.c?r1=1.445.2.14.2.55&r2=1.445.2.14.2.56&diff_format=u
Index: php-src/ext/standard/string.c
diff -u php-src/ext/standard/string.c:1.445.2.14.2.55
php-src/ext/standard/string.c:1.445.2.14.2.56
--- php-src/ext/standard/string.c:1.445.2.14.2.55 Thu May 10 22:10:43 2007
+++ php-src/ext/standard/string.c Thu May 24 20:53:05 2007
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: string.c,v 1.445.2.14.2.55 2007/05/10 22:10:43 tony2001 Exp $ */
+/* $Id: string.c,v 1.445.2.14.2.56 2007/05/24 20:53:05 rasmus Exp $ */
/* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
@@ -3016,7 +3016,7 @@
php_charmask(what, wlength, flags TSRMLS_CC);
- for (source = str, end = source + length, target = new_str; (c =
*source) || (source < end); source++) {
+ for (source = str, end = source + length, target = new_str; source <
end; source++) {
if (flags[(unsigned char)c]) {
if ((unsigned char) c < 32 || (unsigned char) c > 126) {
*target++ = '\\';
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php