moriyoshiTue, 09 Nov 2010 03:23:04 +
Revision: http://svn.php.net/viewvc?view=revision&revision=305214
Log:
- Fix bug #53273 (mb_strcut() returns garbage with the excessive length
parameter).
Bug: http://bugs.php.net/53273 (Open) mb_strcut() returns garbage with the
excessive length parameter
Changed paths:
A
php/php-src/branches/PHP_5_2/ext/mbstring/tests/mb_strcut_missing_boundary_check.phpt
U php/php-src/branches/PHP_5_3/NEWS
U php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/mbfl/mbfilter.c
A
php/php-src/branches/PHP_5_3/ext/mbstring/tests/mb_strcut_missing_boundary_check.phpt
U php/php-src/trunk/ext/mbstring/libmbfl/mbfl/mbfilter.c
A
php/php-src/trunk/ext/mbstring/tests/mb_strcut_missing_boundary_check.phpt
Added:
php/php-src/branches/PHP_5_2/ext/mbstring/tests/mb_strcut_missing_boundary_check.phpt
===
---
php/php-src/branches/PHP_5_2/ext/mbstring/tests/mb_strcut_missing_boundary_check.phpt
(rev 0)
+++
php/php-src/branches/PHP_5_2/ext/mbstring/tests/mb_strcut_missing_boundary_check.phpt
2010-11-09 03:23:04 UTC (rev 305214)
@@ -0,0 +1,62 @@
+--TEST--
+mb_strcut() missing boundary check.
+--SKIPIF--
+
+--FILE--
+
+--FILE--
+val + from;
end = start + (length & -4);
} else if ((encoding->flag & MBFL_ENCTYPE_SBCS)) {
+ if (from + length >= string->len) {
+ length = string->len - from;
+ }
+
start = string->val + from;
end = start + length;
} else if (encoding->mblen_table != NULL) {
Added:
php/php-src/branches/PHP_5_3/ext/mbstring/tests/mb_strcut_missing_boundary_check.phpt
===
---
php/php-src/branches/PHP_5_3/ext/mbstring/tests/mb_strcut_missing_boundary_check.phpt
(rev 0)
+++
php/php-src/branches/PHP_5_3/ext/mbstring/tests/mb_strcut_missing_boundary_check.phpt
2010-11-09 03:23:04 UTC (rev 305214)
@@ -0,0 +1,31 @@
+--TEST--
+mb_strcut() missing boundary check.
+--SKIPIF--
+
+--FILE--
+val + from;
end = start + (length & -4);
} else if ((encoding->flag & MBFL_ENCTYPE_SBCS)) {
+ if (from + length >= string->len) {
+ length = string->len - from;
+ }
+
start = string->val + from;
end = start + length;
} else if (encoding->mblen_table != NULL) {
Added:
php/php-src/trunk/ext/mbstring/tests/mb_strcut_missing_boundary_check.phpt
===
--- php/php-src/trunk/ext/mbstring/tests/mb_strcut_missing_boundary_check.phpt
(rev 0)
+++ php/php-src/trunk/ext/mbstring/tests/mb_strcut_missing_boundary_check.phpt
2010-11-09 03:23:04 UTC (rev 305214)
@@ -0,0 +1,31 @@
+--TEST--
+mb_strcut() missing boundary check.
+--SKIPIF--
+
+--FILE--
+--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php