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

Git BuildData caches remoteUrls without trimming strings

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • git-plugin
    • None

      It is a follow-up to https://github.com/jenkinsci/git-plugin/pull/484#discussion_r105220902

      BuildData exposes public API for contributing remoteUrls as strings, but there is no trimming of incoming values.

      > Similarity check for remote URL lists... We may also get false negative if values like "

      {remoteUrl}" and " {remoteUrl}

      " sneak into the set (due to the size check above). I would vote for explicit trimming of strings in places like https://github.com/stephenc/git-plugin/blob/b8f94dfed07e996e87dff4f27615bc82ff8103c3/src/main/java/hudson/plugins/git/util/BuildData.java#L77 and https://github.com/stephenc/git-plugin/blob/b8f94dfed07e996e87dff4f27615bc82ff8103c3/src/main/java/hudson/plugins/git/util/BuildData.java#L208 . Ant to the original code

       

       

          [JENKINS-42665] Git BuildData caches remoteUrls without trimming strings

          Mark Waite added a comment -

          I believe that the normalization of BuildData remote URL's which was added in a recent version should be enough to handle the case of whitespace differences. It probably won't handle the expanded parameter case.

          Mark Waite added a comment - I believe that the normalization of BuildData remote URL's which was added in a recent version should be enough to handle the case of whitespace differences. It probably won't handle the expanded parameter case.

            Unassigned Unassigned
            oleg_nenashev Oleg Nenashev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: