cvs: php-src(PHP_5_2) /ext/mbstring mbstring.c
| From: | Rui Hirokawa | Date: | Sun, 17 Feb 2008 02:06:56 +0000 |
| Subject: | cvs: php-src(PHP_5_2) /ext/mbstring mbstring.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-48609@lists.php.net to get a copy of this message | ||
hirokawa Sun Feb 17 02:06:56 2008 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/mbstring mbstring.c
Log:
MF PHP5_3 (fixed #43841)
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/mbstring.c?r1=1.224.2.22.2.29&r2=1.224.2.22.2.30&diff_format=u
Index: php-src/ext/mbstring/mbstring.c
diff -u php-src/ext/mbstring/mbstring.c:1.224.2.22.2.29
php-src/ext/mbstring/mbstring.c:1.224.2.22.2.30
--- php-src/ext/mbstring/mbstring.c:1.224.2.22.2.29 Sun Feb 17 01:59:03 2008
+++ php-src/ext/mbstring/mbstring.c Sun Feb 17 02:06:56 2008
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mbstring.c,v 1.224.2.22.2.29 2008/02/17 01:59:03 hirokawa Exp $ */
+/* $Id: mbstring.c,v 1.224.2.22.2.30 2008/02/17 02:06:56 hirokawa Exp $ */
/*
* PHP 4 Multibyte String module "mbstring"
@@ -1726,6 +1726,13 @@
if (needle.len <= 0) {
RETURN_FALSE;
}
+
+ if ((offset > 0 && offset > mbfl_strlen(&haystack)) ||
+ (offset < 0 && -offset > mbfl_strlen(&haystack))) {
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Offset is greater than the length of haystack
string");
+ RETURN_FALSE;
+ }
+
n = mbfl_strpos(&haystack, &needle, offset, 1);
if (n >= 0) {
RETVAL_LONG(n);