stas            Thu Sep 20 21:55:15 2007 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/ext/iconv  iconv.c 
  Log:
  fix potential overflow (Mattias Bengtsson)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/iconv/iconv.c?r1=1.124.2.8.2.17&r2=1.124.2.8.2.18&diff_format=u
Index: php-src/ext/iconv/iconv.c
diff -u php-src/ext/iconv/iconv.c:1.124.2.8.2.17 
php-src/ext/iconv/iconv.c:1.124.2.8.2.18
--- php-src/ext/iconv/iconv.c:1.124.2.8.2.17    Wed Sep 19 00:30:52 2007
+++ php-src/ext/iconv/iconv.c   Thu Sep 20 21:55:14 2007
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: iconv.c,v 1.124.2.8.2.17 2007/09/19 00:30:52 stas Exp $ */
+/* $Id: iconv.c,v 1.124.2.8.2.18 2007/09/20 21:55:14 stas Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -700,11 +700,11 @@
                }
        }
 
-       if (offset >= total_len) {
+       if (offset >= total_len || len > total_len) {
                return PHP_ICONV_ERR_SUCCESS;
        }
 
-       if ((offset + len) > total_len) {
+       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

Reply via email to