Search Options

Results per page
Sort
Preferred Languages
Advance

Results 41 - 50 of 58 for ArrayIndexOutOfBoundsException (0.32 sec)

  1. 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: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 14.1K bytes
    - Viewed (0)
  2. 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: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 14.1K bytes
    - Viewed (0)
  3. 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: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 18.1K bytes
    - Viewed (0)
  4. 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: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 7.9K bytes
    - Viewed (0)
  5. 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: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 24.9K bytes
    - Viewed (0)
  6. 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: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 24.8K bytes
    - Viewed (0)
  7. 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: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 15.8K bytes
    - Viewed (0)
  8. 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: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 14K bytes
    - Viewed (0)
  9. 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: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 20.5K bytes
    - Viewed (0)
  10. src/test/java/jcifs/internal/smb2/io/Smb2FlushResponseTest.java

            void testReadBytesWireFormatInsufficientBuffer() {
                // Given
                byte[] buffer = new byte[1]; // Too small
    
                // When & Then
                assertThrows(ArrayIndexOutOfBoundsException.class, () -> response.readBytesWireFormat(buffer, 0));
            }
    
            @Test
            @DisplayName("Should handle negative structure size as unsigned")
    Registered: Sun Sep 07 00:10:21 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 10.3K bytes
    - Viewed (0)
Back to top