harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r823140 - /harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/zip/ZipFile.java
Date Thu, 08 Oct 2009 12:16:43 GMT
Author: tellison
Date: Thu Oct  8 12:16:43 2009
New Revision: 823140

URL: http://svn.apache.org/viewvc?rev=823140&view=rev
Log:
Avoid potential long arithmetic overflow.

Modified:
    harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/zip/ZipFile.java

Modified: harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/zip/ZipFile.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/zip/ZipFile.java?rev=823140&r1=823139&r2=823140&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/zip/ZipFile.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/archive/src/main/java/java/util/zip/ZipFile.java
Thu Oct  8 12:16:43 2009
@@ -393,7 +393,7 @@
         public int read(byte[] b, int off, int len) throws IOException {
             synchronized (mSharedRaf) {
                 mSharedRaf.seek(mOffset);
-                if (mOffset + len > mLength) {
+                if (len > mLength - mOffset) {
                     len = (int) (mLength - mOffset);
                 }
                 int count = mSharedRaf.read(b, off, len);



Mime
View raw message