[SERVER-20737] StringData::compare can illegally pass nullptr to memcmp Created: 02/Oct/15 Updated: 27/Oct/15 Resolved: 19/Oct/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | None |
| Fix Version/s: | 3.2.0-rc1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Andrew Morrow (Inactive) | Assignee: | Andrew Morrow (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | undefined-sanitizer | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible |
| Operating System: | ALL |
| Sprint: | Platform B (10/30/15) |
| Participants: |
| Description |
|
It is undefined behavior to pass nullptr for either pointer argument to memcmp, however, StringData::compare does not guard against this. A default constructed StringData, for instance, has a nullptr _data member. |
| Comments |
| Comment by Githook User [ 19/Oct/15 ] |
|
Author: {u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}Message: |