- Sort Score
- Result 10 results
- Languages All
Results 21 - 30 of 35 for ArrayIndexOutOfBoundsException (0.45 sec)
-
src/test/java/jcifs/internal/smb2/create/Smb2CloseRequestTest.java
@DisplayName("Test buffer overflow protection") void testBufferOverflowProtection() { byte[] smallBuffer = new byte[23]; // One byte too small // Should throw ArrayIndexOutOfBoundsException assertThrows(ArrayIndexOutOfBoundsException.class, () -> { request.writeBytesWireFormat(smallBuffer, 0); }); } @Test @DisplayName("Test file ID boundary values")Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 20.5K bytes - Viewed (0) -
src/test/java/jcifs/internal/smb1/trans2/Trans2QueryPathInformationResponseTest.java
byte[] buffer = new byte[0]; response.setDataCount(0); // The implementation will try to decode even with an empty buffer, causing ArrayIndexOutOfBoundsException assertThrows(ArrayIndexOutOfBoundsException.class, () -> { response.readDataWireFormat(buffer, 0, 0); }); } @Test @DisplayName("Test toString method") void testToString() {Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 11.9K bytes - Viewed (0) -
src/test/java/jcifs/internal/smb2/io/Smb2FlushRequestTest.java
@DisplayName("Test buffer overflow protection") void testBufferOverflowProtection() { byte[] smallBuffer = new byte[23]; // One byte too small // Should throw ArrayIndexOutOfBoundsException assertThrows(ArrayIndexOutOfBoundsException.class, () -> { request.writeBytesWireFormat(smallBuffer, 0); }); } @Test @DisplayName("Test file ID boundary values")Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 11.5K bytes - Viewed (0) -
src/test/java/jcifs/internal/smb1/com/SmbComSeekResponseTest.java
void testReadParameterWordsWithShortBuffer() { byte[] buffer = new byte[] { 0x00, 0x01, 0x02 }; // only three bytes assertThrows(ArrayIndexOutOfBoundsException.class, () -> response.readParameterWordsWireFormat(buffer, 0)); } @Test @DisplayName("readParameterWordsWireFormat with null buffer - throws NullPointerException")
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 8.1K bytes - Viewed (0) -
src/test/java/jcifs/internal/smb2/tree/Smb2TreeDisconnectRequestTest.java
Smb2TreeDisconnectRequest request = new Smb2TreeDisconnectRequest(mockConfig); byte[] buffer = new byte[3]; // Too small for 4 bytes // When & Then assertThrows(ArrayIndexOutOfBoundsException.class, () -> { request.writeBytesWireFormat(buffer, 0); }); } @Test @DisplayName("Should throw exception when offset exceeds buffer")
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 14.1K bytes - Viewed (0) -
src/test/java/jcifs/internal/smb2/tree/Smb2TreeDisconnectResponseTest.java
void testReadBytesWireFormatBufferTooSmall() { // Given byte[] buffer = new byte[1]; // Too small to read structure size // When & Then assertThrows(ArrayIndexOutOfBoundsException.class, () -> { response.readBytesWireFormat(buffer, 0); }); } @Test @DisplayName("Should throw exception when offset exceeds buffer for reading")
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 14.1K bytes - Viewed (0) -
src/test/java/jcifs/internal/smb2/io/Smb2ReadRequestTest.java
request.setFileId(shortFileId); byte[] buffer = new byte[256]; // Should handle gracefully or throw appropriate exception assertThrows(ArrayIndexOutOfBoundsException.class, () -> request.writeBytesWireFormat(buffer, 0)); } @Test @DisplayName("Should handle all parameters at maximum") void testAllParametersMaximum() {
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 24.8K bytes - Viewed (0) -
src/test/java/jcifs/internal/smb1/net/NetShareEnumTest.java
@DisplayName("Test writeParametersWireFormat with small buffer throws ArrayIndexOutOfBoundsException") void testWriteParametersWireFormatSmallBuffer() { netShareEnum = new NetShareEnum(realConfig); // Buffer too small for the full parameters (need at least 19 bytes) byte[] dst = new byte[10]; assertThrows(ArrayIndexOutOfBoundsException.class, () -> {Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 15.8K bytes - Viewed (0) -
src/test/java/jcifs/smb/SIDCacheImplTest.java
assertThrows(NullPointerException.class, () -> cache.resolveSids(ctx, "server", null, 0, 1)); // Bad offset/length leads to ArrayIndexOutOfBoundsException jcifs.SID[] sids = new jcifs.SID[] { sid("S-1-1-0") }; assertThrows(ArrayIndexOutOfBoundsException.class, () -> cache.resolveSids(ctx, "server", sids, 1, 2)); } @Nested class EdgeCasesForResolveSids { @Test
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 14K bytes - Viewed (0) -
src/test/java/jcifs/internal/smb2/tree/Smb2TreeConnectRequestTest.java
Smb2TreeConnectRequest req = new Smb2TreeConnectRequest(mockConfig, longPath); byte[] smallBuffer = new byte[20]; // Too small for header + path // When & Then assertThrows(ArrayIndexOutOfBoundsException.class, () -> { req.encode(smallBuffer, 0); }); } @Test @DisplayName("Should correctly inherit from ServerMessageBlock2Request") void testInheritance() {
Registered: Sat Dec 20 13:44:44 UTC 2025 - Last Modified: Thu Aug 14 05:31:44 UTC 2025 - 18.6K bytes - Viewed (0)