stas Thu Sep 20 22:38:25 2007 UTC
Modified files:
/php-src/ext/iconv iconv.c
Log:
better fix for iconv_substr
http://cvs.php.net/viewvc.cgi/php-src/ext/iconv/iconv.c?r1=1.155&r2=1.156&diff_format=u
Index: php-src/ext/iconv/iconv.c
diff -u php-src/ext/iconv/iconv.c:1.155 php-src/ext/iconv/iconv.c:1.156
--- php-src/ext/iconv/iconv.c:1.155 Thu Sep 20 21:57:11 2007
+++ php-src/ext/iconv/iconv.c Thu Sep 20 22:38:25 2007
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: iconv.c,v 1.155 2007/09/20 21:57:11 stas Exp $ */
+/* $Id: iconv.c,v 1.156 2007/09/20 22:38:25 stas Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -765,10 +765,14 @@
}
}
- if (offset >= total_len || len > total_len) {
+ if(len > total_len) {
+ len = total_len;
+ }
+
+ if (offset >= total_len) {
return PHP_ICONV_ERR_SUCCESS;
}
-
+
if ((offset + len) > total_len) {
/* trying to compute the length */
len = total_len - offset;
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php