Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 35 for ArrayIndexOutOfBoundsException (0.26 sec)

  1. 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)
  2. src/test/java/jcifs/internal/smb2/ioctl/ValidateNegotiateInfoRequestTest.java

            // Create buffer smaller than required size
            byte[] smallBuffer = new byte[request.size() - 1];
    
            assertThrows(ArrayIndexOutOfBoundsException.class, () -> {
                request.encode(smallBuffer, 0);
            });
        }
    
        @Test
        @DisplayName("Test encode with offset exceeding buffer throws exception")
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 11.7K bytes
    - Viewed (0)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. 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() {
            // Arrange
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 5.4K bytes
    - Viewed (0)
  9. src/test/java/jcifs/internal/smb2/lock/Smb2LockRequestTest.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 buffer overflow protection")
            void testBufferOverflowProtection() {
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 25.3K bytes
    - Viewed (0)
  10. src/test/java/jcifs/internal/smb2/lock/Smb2LockResponseTest.java

                // Given
                byte[] buffer = new byte[1]; // Too small to read 2-byte structure size
    
                // When & Then
                assertThrows(ArrayIndexOutOfBoundsException.class, () -> response.readBytesWireFormat(buffer, 0));
            }
    
            @Test
            @DisplayName("Should throw exception when buffer index out of bounds")
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 17.1K bytes
    - Viewed (0)
Back to top