Details
-
Bug
-
Resolution: Fixed
-
Major - P3
-
None
-
None
-
None
-
Fully Compatible
-
ALL
-
Service Arch 2023-04-03
Description
The MONGO_HAVE_STD_IS_TRIVIALLY_COPYABLE macro is not defined in our codebase. Unfortunately, we still reference it, and safety checks will change their behavior based on it.
In particular DataRange-like types use a data serializer/deserializer template called DataType::Handler, whose default implementation guards a safety check behind MONGO_HAVE_STD_IS_TRIVIALLY_COPYABLE. This guard prevents the safety check from being evaluated. As a result, code like
uassertStatusOK(bodyBuilder.writeAndAdvance<std::string>(reply.body));
|
Will incorrectly compile and run, and will not load reply.body's text into the builder.