Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-3215

Bad quote management in commands

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • jabber-plugin
    • None
    • Platform: All, OS: All

    Description

      trunk/hudson/plugins/jabber/src/main/java/hudson/plugins/jabber/tools/MessageHelper.java

      49 int firstQuote = commandLine.indexOf(QUOTE);
      (...)
      60 parameters
      61 .add(commandLine.substring(firstQuote + 1, endQuoted));

      firstQuote+1 is wrong if the quote is the last char.

      java.lang.StringIndexOutOfBoundsException: String index out of range: -16
      at java.lang.String.substring(String.java:1949)
      at
      hudson.plugins.jabber.tools.MessageHelper.extractParameters(MessageHelper.java:60)
      at
      hudson.plugins.jabber.tools.MessageHelper.extractCommandLine(MessageHelper.java:39)
      at hudson.plugins.jabber.im.transport.bot.Bot.processPacket(Bot.java:106)
      at
      org.jivesoftware.smack.PacketReader$ListenerWrapper.notifyListener(PacketReader.java:822)
      at org.jivesoftware.smack.PacketReader.processListeners(PacketReader.java:260)
      at org.jivesoftware.smack.PacketReader.access$100(PacketReader.java:43)
      at org.jivesoftware.smack.PacketReader$2.run(PacketReader.java:72)

      Attachments

        Activity

          kutzi kutzi added a comment -

          I'll look at it

          kutzi kutzi added a comment - I'll look at it
          kutzi kutzi added a comment -

          fixed in upcoming 0.10

          kutzi kutzi added a comment - fixed in upcoming 0.10

          Code changed in hudson
          User: : kutzi
          Path:
          trunk/hudson/plugins/jabber/src/main/java/hudson/plugins/jabber/tools/MessageHelper.java
          trunk/hudson/plugins/jabber/src/test/java/hudson/plugins/jabber/tools/MessageHelperTest.java
          http://fisheye4.cenqua.com/changelog/hudson/?cs=21028
          Log:
          JENKINS-3215 fixed handling of single quotes

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : kutzi Path: trunk/hudson/plugins/jabber/src/main/java/hudson/plugins/jabber/tools/MessageHelper.java trunk/hudson/plugins/jabber/src/test/java/hudson/plugins/jabber/tools/MessageHelperTest.java http://fisheye4.cenqua.com/changelog/hudson/?cs=21028 Log: JENKINS-3215 fixed handling of single quotes

          People

            kutzi kutzi
            bsibaud bsibaud
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: