[SERVER-30986] Server should error on invalid regex match expressions Created: 07/Sep/17 Updated: 30/Oct/23 Resolved: 19/Sep/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 2.6.12, 3.0.15, 3.2.16, 3.4.7 |
| Fix Version/s: | 3.6.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | David Storch | Assignee: | Blake Oler |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||
| Sprint: | Query 2017-10-02 | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Description |
|
The server accepts invalid regular expressions in the match language. It appears that such invalid regular expressions will match nothing:
In order to fix this, the MatchExpression library should call pcrecpp::RE::error() and check whether the resulting error string is non-empty: This bug appears to affect all versions of the server since at least 2.6. |
| Comments |
| Comment by Githook User [ 29/Jun/18 ] |
|
Author: {'username': 'ksuarz', 'name': 'Kyle Suarez', 'email': 'kyle.suarez@mongodb.com'}Message: Revert " There exist PCRE regexes whose error strings are nonempty but can still This reverts commit 1531b7b7280dd37d5f7ffd49171a65305ad442ba. (cherry picked from commit e9a6f62b3053733354cabb6d9488d0d4dcc6c424) |
| Comment by Githook User [ 21/Jun/18 ] |
|
Author: {'username': 'ksuarz', 'name': 'Kyle Suarez', 'email': 'kyle.suarez@mongodb.com'}Message: Revert " This reverts commit 1531b7b7280dd37d5f7ffd49171a65305ad442ba. |
| Comment by Githook User [ 20/Jun/18 ] |
|
Author: {'username': 'ksuarz', 'name': 'Kyle Suarez', 'email': 'kyle.suarez@mongodb.com'}Message: Revert " There exist PCRE regexes whose error strings are nonempty but can still This reverts commit 1531b7b7280dd37d5f7ffd49171a65305ad442ba. |
| Comment by Githook User [ 19/Sep/17 ] |
|
Author: {'username': 'BlakeIsBlake', 'name': 'Blake Oler', 'email': 'blake.oler@10gen.com'}Message: |