iliaa Sun Feb 1 19:42:48 2009 UTC
Modified files: (Branch: PHP_5_2)
/php-src/main spprintf.c
Log:
Fixed a possible invalid read when string is not null terminated
http://cvs.php.net/viewvc.cgi/php-src/main/spprintf.c?r1=1.25.2.2.2.13&r2=1.25.2.2.2.14&diff_format=u
Index: php-src/main/spprintf.c
diff -u php-src/main/spprintf.c:1.25.2.2.2.13
php-src/main/spprintf.c:1.25.2.2.2.14
--- php-src/main/spprintf.c:1.25.2.2.2.13 Wed Dec 31 11:17:48 2008
+++ php-src/main/spprintf.c Sun Feb 1 19:42:48 2009
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: spprintf.c,v 1.25.2.2.2.13 2008/12/31 11:17:48 sebastian Exp $ */
+/* $Id: spprintf.c,v 1.25.2.2.2.14 2009/02/01 19:42:48 iliaa Exp $ */
/* This is the spprintf implementation.
* It has emerged from apache snprintf. See original header:
@@ -547,9 +547,11 @@
case 'v':
s = va_arg(ap, char *);
if (s != NULL) {
- s_len = strlen(s);
- if (adjust_precision &&
precision < s_len)
+ if (adjust_precision &&
precision) {
s_len = precision;
+ } else {
+ s_len = strlen(s);
+ }
} else {
s = S_NULL;
s_len = S_NULL_LEN;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php