Uploaded image for project: 'Commons Codec'
  1. Commons Codec
  2. CODEC-22

[codec] Base64.isArrayByteBase64() throws an ArrayIndexOutOfBoundsException for negative octets.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.3
    • 1.4
    • None
    • Operating System: other
      Platform: Other

    • 30825

    Description

      If I try org.apache.commons.codec.binary.Base64.isArrayByteBase64() on a
      particular byteArray I get a ArrayIndexOutOfBoundsException.

      Here is the stackTrace:
      java.lang.ArrayIndexOutOfBoundsException: -94
      at org.apache.commons.codec.binary.Base64.isBase64(Base64.java:137)
      at org.apache.commons.codec.binary.Base64.isArrayByteBase64(Base64.java:163)
      at
      it.injava.rosetta.manager.PacketManager.decryptPacket(PacketManager.java:41)
      at it.injava.rosetta.net.MulticastListener.run(MulticastListener.java:95)
      at java.lang.Thread.run(Thread.java:534)

      The correct result should be 'false': absolutely the byteArray is not a Base64
      stream but I want to use this method exactly to understand when byteArray is (or
      it is not) a real Base64 stream.

      Attachments

        1. ASF.LICENSE.NOT.GRANTED--Test.java
          0.3 kB
          Piero Ottuzzi

        Activity

          People

            Unassigned Unassigned
            ottuzzi@libero.it Piero Ottuzzi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: