Uploaded image for project: 'Aesh'
  1. Aesh
  2. AESH-250

Exception if using Backspace too many times on console prompt

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 0.56, 0.33.13
    • None
    • None
    • None

      On S-RAMP, we prompt for a password with:

                  Prompt newPrompt = new Prompt(promptString);
                  return this.consoleReader.read(newPrompt,Character.valueOf((char) 0)).getBuffer();
      

      If you start typing a password, make a mistake, and hit the Backspace n+1 times (where n was the # of typed chars), you get this exception:

       java.lang.ArrayIndexOutOfBoundsException
      at java.lang.System.arraycopy(Native Method)
      at java.lang.AbstractStringBuilder.insert(AbstractStringBuilder.java:1152)
      at java.lang.StringBuilder.insert(StringBuilder.java:336)
      at org.jboss.aesh.console.Buffer.write(Buffer.java:319)
      at org.jboss.aesh.console.Console.writeChar(Console.java:837)
      at org.jboss.aesh.console.Console.writeChars(Console.java:832)
      at org.jboss.aesh.console.Console.parseOperation(Console.java:515)
      at org.jboss.aesh.console.Console.read(Console.java:452)
      at org.overlord.sramp.shell.InteractiveShellCommandReader.promptForPassword(InteractiveShellCommandReader.java:161)
      at org.overlord.sramp.shell.ShellContextImpl.promptForPassword(ShellContextImpl.java:172)
      at org.overlord.sramp.shell.commands.core.ConnectCommand.promptForPassword(ConnectCommand.java:107)
      at org.overlord.sramp.shell.commands.core.ConnectCommand.execute(ConnectCommand.java:67)
      at org.overlord.sramp.shell.SrampShell.run(SrampShell.java:102)
      at org.overlord.sramp.shell.SrampShell.main(SrampShell.java:67)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
      at java.lang.Thread.run(Thread.java:744)
      

              spederse@redhat.com Stale Pedersen
              brmeyer_jira Brett Meyer (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: