[SERVER-22532] $type with invalid integer type code fails with unhelpful message and leaks memory Created: 09/Feb/16  Updated: 20/Nov/16  Resolved: 12/Feb/16

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 3.2.4, 3.3.2

Type: Bug Priority: Major - P3
Reporter: David Storch Assignee: David Storch
Resolution: Done Votes: 0
Labels: code-and-test
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-22626 fix $type unit tests on experimental ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Completed:
Steps To Reproduce:

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

Sprint: Query 10 (02/22/16)
Participants:
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.



 Comments   
Comment by Githook User [ 22/Feb/16 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-22532 fail cleanly for $type predicates with invalid numerical type codes

(cherry picked from commit c827c55f02b3a97f001f9935ffc5ddef0520b07a)
Branch: v3.2
https://github.com/mongodb/mongo/commit/cedea56a9fbd65ad8ecf42828ceb9cc639e03bc8

Comment by Githook User [ 12/Feb/16 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-22532 fail cleanly for $type predicates with invalid numerical type codes
Branch: master
https://github.com/mongodb/mongo/commit/c827c55f02b3a97f001f9935ffc5ddef0520b07a

Generated at Thu Feb 08 04:00:40 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.