- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 37 for ArrayIndexOutOfBoundsException (0.96 sec)
-
src/test/java/jcifs/internal/smb2/tree/Smb2TreeConnectResponseTest.java
// Given byte[] buffer = new byte[15]; // Too small for 16-byte structure SMBUtil.writeInt2(16, buffer, 0); // When & Then assertThrows(ArrayIndexOutOfBoundsException.class, () -> { response.readBytesWireFormat(buffer, 0); }); } @Test @DisplayName("Should handle offset exceeding buffer") void testOffsetExceedsBuffer() {Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 07:14:38 UTC 2025 - 19.3K bytes - Viewed (0) -
src/test/java/jcifs/internal/smb1/net/NetServerEnum2Test.java
byte[] dst = new byte[10]; // Too small for the full parameters // Should throw ArrayIndexOutOfBoundsException assertThrows(ArrayIndexOutOfBoundsException.class, () -> { netServerEnum2.writeParametersWireFormat(dst, 0); }); } @Test @DisplayName("Test writeParametersWireFormat with large buffer succeeds") void testWriteParametersWireFormatLargeBuffer() {
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 19.7K bytes - Viewed (0) -
src/test/java/jcifs/internal/smb2/ioctl/ValidateNegotiateInfoRequestTest.java
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 11.7K bytes - Viewed (0) -
src/test/java/jcifs/internal/smb2/session/Smb2LogoffResponseTest.java
@DisplayName("Insufficient buffer causes ArrayIndexOutOfBoundsException") void shortBuffer_throwsAIOOBE() { // Arrange: length 1 means readInt2 will access index 1 and fail byte[] buffer = new byte[1]; Smb2LogoffResponse resp = newResponse(); // Act & Assert assertThrows(ArrayIndexOutOfBoundsException.class, () -> resp.readBytesWireFormat(buffer, 0)); }Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 4.7K bytes - Viewed (0) -
src/test/java/jcifs/pac/PacTest.java
writeLittleEndianInt(baos, 100); // size writeLittleEndianLong(baos, 1000); // offset way out of bounds byte[] pacData = baos.toByteArray(); // This currently throws ArrayIndexOutOfBoundsException // but should be wrapped in PACDecodingException assertThrows(Exception.class, () -> new Pac(pacData, keys)); } @Test void testZeroBufferCount() throws IOException {
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 7.9K bytes - Viewed (0) -
src/test/java/jcifs/internal/fscc/FileSystemInformationTest.java
FileFsSizeInformation info = new FileFsSizeInformation(); byte[] buffer = new byte[10]; // Too small // Should throw ArrayIndexOutOfBoundsException for insufficient buffer assertThrows(ArrayIndexOutOfBoundsException.class, () -> { info.decode(buffer, 0, buffer.length); }); } @ParameterizedTest
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 18.1K bytes - Viewed (0) -
src/test/java/jcifs/internal/smb2/io/Smb2WriteRequestTest.java
byte[] data = new byte[100]; request.setData(data, 200, 50); // Offset beyond array byte[] buffer = new byte[256]; assertThrows(ArrayIndexOutOfBoundsException.class, () -> request.writeBytesWireFormat(buffer, 0)); } @Test @DisplayName("Should handle negative offset") void testNegativeOffset() {
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 22.4K bytes - Viewed (0) -
src/test/java/jcifs/internal/smb1/trans/TransCallNamedPipeResponseTest.java
} @Test void testReadDataWireFormatWithNegativeLength() { byte[] buffer = new byte[100]; // Negative length should cause ArrayIndexOutOfBoundsException from System.arraycopy assertThrows(ArrayIndexOutOfBoundsException.class, () -> response.readDataWireFormat(buffer, 0, -1)); }Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 8.8K bytes - Viewed (0) -
src/test/java/jcifs/internal/smb2/create/CreateContextRequestTest.java
if (dstIndex < 0) { throw new IllegalArgumentException("Destination index cannot be negative"); } if (dstIndex + encodedSize > dst.length) { throw new ArrayIndexOutOfBoundsException("Buffer overflow"); } // Simulate encoding: write header (8 bytes) Arrays.fill(dst, dstIndex, dstIndex + 8, (byte) 0xFF); int offset = dstIndex + 8;
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 24.9K bytes - Viewed (0) -
src/test/java/jcifs/internal/smb2/session/Smb2LogoffRequestTest.java
// Arrange Smb2LogoffRequest req = newRequest(); byte[] tiny = new byte[3]; // less than 4 bytes available // Act/Assert assertThrows(ArrayIndexOutOfBoundsException.class, () -> req.writeBytesWireFormat(tiny, 0)); } @Test @DisplayName("writeBytesWireFormat throws with negative index") void writeBytesWireFormat_throwsIfNegativeIndex() { // ArrangeRegistered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 5.4K bytes - Viewed (0)