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

$type with invalid integer type code fails with unhelpful message and leaks memory

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.2.4, 3.3.2
    • Component/s: Querying
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Completed:
    • Steps To Reproduce:
      Hide

      db.c.drop();
      db.c.ensureIndex({a: 1});
      db.c.find({a: { $type: -100663046}}).hint({a: 1}).itcount();
      

      Show
      db.c.drop(); db.c.ensureIndex({a: 1}); db.c.find({a: { $type: -100663046}}).hint({a: 1}).itcount();
    • Sprint:
      Query 10 (02/22/16)
    • Linked BF Score:
      0

      Description

      The $type MatchExpression parsing code fails to validate that the numerical type code is valid. This leads to an unexpected exception being thrown inside the query planner, which in turn leaks memory.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: