Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-45063

Fix bug in mongo::uriDecode

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.7.0
    • Affects Version/s: None
    • Component/s: None
    • Fully Compatible
    • ALL
    • Dev Tools 2019-12-30, Dev Tools 2020-01-13, Dev Tools 2020-01-27, Execution Team 2020-04-20

      In mongo, we use mongo::uriDecode to decode the encoded uri. But there is a bug corner case. For example:
      If the toDecode string is %2(the %2 must be a wrong uri, because it is partial escape sequence at end of string), the size of toDecode is 2. when i is 0, i + 2 = 2, so i + 2 > toDecode.size() is not satisfied, so the process does not enter the branch of if (i + 2 > toDecode.size()), which would return a right status like this:
      return Status(ErrorCodes::FailedToParse, "Encountered partial escape sequence at end of string")

            Assignee:
            henrik.edin@mongodb.com Henrik Edin
            Reporter:
            daniel.hatcher@mongodb.com Danny Hatcher (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: