Uploaded image for project: 'Subversion'
  1. Subversion
  2. SVN-1947

svn_path_uri_decode may copy garbage and overrun buffer when given partial % escape

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • all
    • 1.1-consider
    • libsvn_subr
    • None

    Description

      File libsvn_subr/path.c r10145 line 874: when checking for a % escape code in
      url to be decoded, the two following digits are copied from the input without
      checking if input ends in the middle.
      
      The result is that trailing garbage (including the \0) is copied along. Because
      the string buffer size is only set at the beginning to worst case assumption, it
      is not grown accordingly and will be overrun in that situation.
      
      Check should be
      
            else if (c == '%' && path[i + 1] && path[i + 2])
      

      http://www.contactor.se/~dast/svn/archive-2004-07/0167.shtml

      Original issue reported by kre

      Attachments

        1. 1_path.c_r10145_issue1947.patch
          0.5 kB
          Subversion Importer
        2. 2_path-test.c_r10145_issue1947.patch
          2 kB
          Subversion Importer
        3. 3_path.c_r10145_issue1947_2.patch
          0.7 kB
          Subversion Importer

        Activity

          People

            Unassigned Unassigned
            subversion-importer Subversion Importer
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: