1
0
mirror of https://github.com/square/okhttp.git synced 2026-01-25 16:01:38 +03:00

Merge pull request #289 from levelup/double-negative

the numberOfPairs may not be negative when numberOfPairs*2 is negative
This commit is contained in:
Jesse Wilson
2013-08-20 16:46:21 -07:00

View File

@@ -281,7 +281,7 @@ final class Spdy3 implements Variant {
this.compressedLimit += length;
try {
int numberOfPairs = nameValueBlockIn.readInt();
if (numberOfPairs < 0) {
if ((numberOfPairs * 2) < 0) {
Logger.getLogger(getClass().getName()).warning("numberOfPairs < 0: " + numberOfPairs);
throw ioException("numberOfPairs < 0");
}