Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
ARTEMIS-1482 Add back check for SimpleString #2227
The test that was added in the original PR for ARTEMIS-1482 testOutOfBoundsThrownOnMalformedString seems to still pass on master, as such should this test be updated?
e.g. IndexOutOfBoundsException is thrown correctly
java.lang.IndexOutOfBoundsException: readerIndex(4) + length(100) exceeds writerIndex(4): PooledUnsafeDirectByteBuf(ridx: 4, widx: 4, cap: 5)
I assume @franz1981 removed it, because he knew the ByteBuf does this check anyhow, so is there another way to get this to occur and not throw IndexOutOfBoundsException, as such maybe a new/updated test case for it?
@michaelandrepearce I agree, if you can come up with an appropriate test it would be beneficial. The reason the test still passed was due to the IOOB exception being moved to a different position in the stack. So, it was thrown but only after the byte array memory was allocated.