Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-8357

EncodingGroovyMethods.decodeBase64() throws "bad character in base64 value" when meets \t \r

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.12
    • Fix Version/s: 2.4.13
    • Component/s: groovy-runtime
    • Labels:
      None

      Description

      EncodingGroovyMethods.decodeBase64() throws "bad character in base64 value" RuntimeException when the method meets \t \r character.
      I found in org.codehaus.groovy.runtime.EncodingGroovyMethodsSupport.TRANSLATE_TABLE has a mistake:
      static final byte[] TRANSLATE_TABLE = (
      "\u0042\u0042\u0042\u0042\u0042\u0042\u0042\u0042"
      // \t \n \r
      + "\u0042\u0042\u0041\u0041\u0042\u0042\u0041\u0042"
      ...
      I mark them in color.
      I believe it's an offset mistake.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                paulk Paul King
                Reporter:
                xingplus Xin
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: