-
Type:
Task
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Fully Compatible
-
None
-
None
-
None
-
None
-
None
-
None
-
None
bson_mutator.cpp declares a static BSONDomainMap called default_domains_.
It's consumed in methods like
BSONObjImpl& BSONObjImpl::WithAny(const std::string& name) {
_inputElements.try_emplace(name, default_domains_);
return *this;
}
If a caller every invokes BSONObjImpl::WithAny in the context of a static constructor defined in another TU, it is undefined whether default_domains_ will have constructed.
The FUZZ_TEST macro uses a static object to register tests.
Thus, we must move default_domains to a singleton, which initializes the object on first use. This will prevent the potential SIOF.