Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for ArrayIndexOutOfBoundsException (1.45 sec)

  1. src/test/java/jcifs/smb/DosErrorTest.java

        }
    
        @Test
        @DisplayName("Messages: accessing invalid index throws ArrayIndexOutOfBoundsException")
        void messagesOutOfBoundsThrows() {
            // Arrange
            String[] msgs = DosError.DOS_ERROR_MESSAGES;
    
            // Act & Assert: negative index
            assertThrows(ArrayIndexOutOfBoundsException.class, () -> {
                @SuppressWarnings("unused")
                String s = msgs[-1];
            });
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 5.9K bytes
    - Viewed (0)
  2. src/test/java/jcifs/internal/smb1/com/SmbComLockingAndXTest.java

            assertTrue(repr.contains("newOplockLevel=2"));
        }
    
        /**
         * Test decoding of bytes buffer that is too short triggers an exception.
         * Note: The actual implementation throws ArrayIndexOutOfBoundsException
         * when the buffer is too short, not SMBProtocolDecodingException.
         */
        @Test
        void readBytesWireFormatTooShortException() {
            Configuration cfg = mock(Configuration.class);
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 7.1K bytes
    - Viewed (0)
  3. src/test/java/jcifs/EncodableTest.java

        void encodeThrowsWhenDestinationTooSmall() {
            byte[] src = makeSeq(5);
            Encodable enc = new ByteEncodable(src, 0, 5);
            byte[] dst = new byte[4]; // too small
    
            assertThrows(ArrayIndexOutOfBoundsException.class, () -> enc.encode(dst, 0),
                    "System.arraycopy should throw for insufficient destination space");
        }
    
        @Test
        @DisplayName("encode() throws when dstIndex causes overflow")
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 4.6K bytes
    - Viewed (0)
  4. src/test/java/jcifs/dcerpc/DcerpcExceptionTest.java

            // The current implementation has a bug in the binary search that causes ArrayIndexOutOfBoundsException
            assertThrows(ArrayIndexOutOfBoundsException.class, () -> {
                DcerpcException.getMessageByDcerpcError(unknownCode);
            }, "Should throw ArrayIndexOutOfBoundsException due to binary search bug");
        }
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Thu Aug 14 05:31:44 UTC 2025
    - 5.8K bytes
    - Viewed (0)
  5. 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)
  6. 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)
  7. 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)
  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/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)
  10. src/main/java/jcifs/smb1/util/MD4.java

            // make sure we don't exceed input's allocated size/length
            if (offset < 0 || len < 0 || (long) offset + len > input.length) {
                throw new ArrayIndexOutOfBoundsException();
            }
    
            // compute number of bytes still unhashed; ie. present in buffer
            int bufferNdx = (int) (count % BLOCK_LENGTH);
            count += len; // update number of bytes
    Registered: Sat Dec 20 13:44:44 UTC 2025
    - Last Modified: Sat Aug 16 01:32:48 UTC 2025
    - 9.6K bytes
    - Viewed (0)
Back to top