[SERVER-24145] Don't pass nullptr to function parameters marked nonnull Created: 16/May/16  Updated: 06/Jun/16  Resolved: 16/May/16

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 3.3.8

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
Steps To Reproduce:

Run jscore under ubsan

Sprint: Platforms 15 (06/03/16)
Participants:

 Description   

Some functions like memcpy and memcmp do not permit passing a nullptr for any of the pointer arguments, even if the length is null. However, some of our code does this. Under newer libc/ubsan combinations, these parameters are marked with the 'nonnull' attribute, and then ubsan complains when it sees nullptr actually passed, even if it works in practice.



 Comments   
Comment by Githook User [ 16/May/16 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: SERVER-23826 SERVER-24145 Don't pass nullptr to attribute nonnull parameters
Branch: master
https://github.com/mongodb/mongo/commit/e026b3c04ba2ed42b64937f36b36a4cbb6aced6b

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