Changeset 533f762


Ignore:
Timestamp:
Dec 9, 2011 1:19:18 PM (8 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
6d4a9ab
Parents:
49d88f00
Message:

bounds check

File:
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/data/DataHelper.java

    r49d88f00 r533f762  
    14371437    public static byte[] decompress(byte orig[], int offset, int length) throws IOException {
    14381438        if ((orig == null) || (orig.length <= 0)) return orig;
     1439        if (offset + length > orig.length)
     1440            throw new IOException("Bad params arrlen " + orig.length + " off " + offset + " len " + length);
    14391441       
    14401442        ReusableGZIPInputStream in = ReusableGZIPInputStream.acquire();
     
    14591461        System.arraycopy(outBuf.getData(), 0, rv, 0, written);
    14601462        cache.release(outBuf);
     1463        // TODO release in finally block
    14611464        ReusableGZIPInputStream.release(in);
    14621465        return rv;
Note: See TracChangeset for help on using the changeset viewer.