DocumentSourceSkip can overflow a long long when combining with adjacent skips

XMLWordPrintableJSON

    • Fully Compatible
    • ALL
    • v3.6, v3.4
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      During optimization, $skip will combine itself with an adjacent $skip, and the new value to skip is the sum of the two. However, the addition is performed without overflow checking. The skip value is stored as a long long, which means that we hit undefined behavior in the event of overflow.

      The unsafe code is in DocumentSourceSkip::doOptimizeAt() in v3.6 and v3.4.

            Assignee:
            Charlie Swanson
            Reporter:
            Kyle Suarez (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: