@Test(expected = Http2Exception.class) public void testDecodeULE128LongOverflow1() throws Http2Exception { byte[] input = {(byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF, (byte) 0xFF}; ByteBuf in = Unpooled.wrappedBuffer(input); final int readerIndex = in.readerIndex(); try { decodeULE128(in, 0L); } finally { assertEquals(readerIndex, in.readerIndex()); in.release(); } }
static int decodeULE128(ByteBuf in, int result) throws Http2Exception { final int readerIndex = in.readerIndex(); final long v = decodeULE128(in, (long) result); if (v > Integer.MAX_VALUE) { in.readerIndex(readerIndex); throw DECODE_ULE_128_TO_INT_DECOMPRESSION_EXCEPTION; } return (int) v; }
HpackDecoder { static int decodeULE128(ByteBuf in, int result) throws Http2Exception { final int readerIndex = in.readerIndex(); final long v = decodeULE128(in, (long) result); if (v > Integer.MAX_VALUE) { in.readerIndex(readerIndex); throw DECODE_ULE_128_TO_INT_DECOMPRESSION_EXCEPTION; } return (int) v; } }
HpackDecoder { static int decodeULE128(ByteBuf in, int result) throws Http2Exception { final int readerIndex = in.readerIndex(); final long v = decodeULE128(in, (long) result); if (v > Integer.MAX_VALUE) { in.readerIndex(readerIndex); throw DECODE_ULE_128_TO_INT_DECOMPRESSION_EXCEPTION; } return (int) v; } HpackDecoder(long maxHeaderListSize, int initialHuffmanDecodeCapacity);   HpackDecoder(long maxHeaderListSize, int initialHuffmanDecodeCapacity, int maxHeaderTableSize); }
HpackDecoder { static int decodeULE128(ByteBuf in, int result) throws Http2Exception { final int readerIndex = in.readerIndex(); final long v = decodeULE128(in, (long) result); if (v > Integer.MAX_VALUE) { in.readerIndex(readerIndex); throw DECODE_ULE_128_TO_INT_DECOMPRESSION_EXCEPTION; } return (int) v; } HpackDecoder(long maxHeaderListSize, int initialHuffmanDecodeCapacity);   HpackDecoder(long maxHeaderListSize, int initialHuffmanDecodeCapacity, int maxHeaderTableSize); void decode(int streamId, ByteBuf in, Http2Headers headers, boolean validateHeaders); void setMaxHeaderTableSize(long maxHeaderTableSize); @Deprecated void setMaxHeaderListSize(long maxHeaderListSize, long maxHeaderListSizeGoAway); void setMaxHeaderListSize(long maxHeaderListSize); long getMaxHeaderListSize(); long getMaxHeaderTableSize(); }
HpackDecoder { static int decodeULE128(ByteBuf in, int result) throws Http2Exception { final int readerIndex = in.readerIndex(); final long v = decodeULE128(in, (long) result); if (v > Integer.MAX_VALUE) { in.readerIndex(readerIndex); throw DECODE_ULE_128_TO_INT_DECOMPRESSION_EXCEPTION; } return (int) v; } HpackDecoder(long maxHeaderListSize, int initialHuffmanDecodeCapacity);   HpackDecoder(long maxHeaderListSize, int initialHuffmanDecodeCapacity, int maxHeaderTableSize); void decode(int streamId, ByteBuf in, Http2Headers headers, boolean validateHeaders); void setMaxHeaderTableSize(long maxHeaderTableSize); @Deprecated void setMaxHeaderListSize(long maxHeaderListSize, long maxHeaderListSizeGoAway); void setMaxHeaderListSize(long maxHeaderListSize); long getMaxHeaderListSize(); long getMaxHeaderTableSize();  }