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

Fix bug in mongo::uriDecode

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.7.0
    • Component/s: None
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Dev Tools 2019-12-30, Dev Tools 2020-01-13, Dev Tools 2020-01-27, Execution Team 2020-04-20

      Description

      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")

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: