Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-10300

Elytron MatchRule.toString() method throws StringIndexOutOfBoundsException

    XMLWordPrintable

Details

    Description

      In case when implementation of asString(StringBuilder b) for MatchRule does not change length of passed parameter (which is 0) then 'java.lang.StringIndexOutOfBoundsException: String index out of range: -1' is thrown for calling MatchRule.toString() due to calling StringBuilder.setLength(-1).

      e.g. MatchRule ALL in implementation asString(StringBuilder b) just returns passed parameter, which results to mentioned exception.

      Thrown exception:

      java.lang.StringIndexOutOfBoundsException: String index out of range: -1
      	at java.lang.AbstractStringBuilder.setLength(AbstractStringBuilder.java:180)
      	at java.lang.StringBuilder.setLength(StringBuilder.java:76)
      	at org.wildfly.security.auth.client.MatchRule.toString(MatchRule.java:581)
          ...
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              olukas Ondrej Lukas (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: