-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
-
ALL
-
v6.0
-
Security 2022-06-27
-
(copied to CRM)
dn_expand returns the length of the compressed string, not the length of the uncompressed string. It fills the buffer with a null-terminated string and so we should construct a string using the non-length constructor for std::string.
See https://github.com/mongodb/mongo/blob/f495bdead326a06a76f8a980e44092deb096a21d/src/mongo/util/dns_query_posix-impl.h#L191
References:
https://www.man7.org/linux/man-pages/man3/dn_expand.3.html