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

Fix undefined behaviour in parsing code for $slice projectional operator

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.4.7, 5.0.0-rc2, 4.2.16, 4.0.27
    • Component/s: None
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v5.0, v4.4, v4.2, v4.0
    • Sprint:
      Query Execution 2021-05-03, Query Execution 2021-05-17, Query Execution 2021-05-31, Query Execution 2021-06-14, Query Execution 2021-06-28
    • Linked BF Score:
      128

      Description

      attemptToParseFindSlice uses BSONElement::numberInt to extract $slice value from BSON here. If BSONElement contains double NaN, +inf or -inf values, this method still converts it to int type here. This is undefined behaviour and is caught by UBSAN.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              nikita.lapkov Nikita Lapkov
              Reporter:
              nikita.lapkov Nikita Lapkov
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: