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

$substrBytes does not handle negative parameters correctly.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.1.4
    • Fix Version/s: 3.7.4
    • Component/s: Aggregation Framework
    • Labels:
    • Backwards Compatibility:
      Minor Change
    • Operating System:
      ALL
    • Sprint:
      Query 2018-03-26

      Description

      $substrBytes requires two arguments: starting index, and length. Parsing and validation occurs here.

      Both are required to be integral, however, we static cast the values to a size_t without checking to ensure they're nonnegative. At the very least, we should give an informative error message if they are negative. It is also conceivable that we want a negative value to mean "return the rest of the string", as in some other operators, in which case we'll need to add special handling.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: