diff --git a/Clover/app/src/main/java/com/android/volley/toolbox/DiskBasedCache.java b/Clover/app/src/main/java/com/android/volley/toolbox/DiskBasedCache.java index bedb66b1..a65a8f4d 100644 --- a/Clover/app/src/main/java/com/android/volley/toolbox/DiskBasedCache.java +++ b/Clover/app/src/main/java/com/android/volley/toolbox/DiskBasedCache.java @@ -322,6 +322,10 @@ public class DiskBasedCache implements Cache { * Reads the contents of an InputStream into a byte[]. * */ private static byte[] streamToBytes(InputStream in, int length) throws IOException { + if (length < 0) { + throw new IOException("length < 0"); + } + byte[] bytes = new byte[length]; int count; int pos = 0;