Description
SDAM requires us to downcase domain names of MongoDB servers:
Our decision was to translate uppercase ASCII chars to lowercase and leave non-ASCII chars unchanged.
The C Driver uses mongoc_lowercase for this. I'm concerned that a multibyte UTF-8 character could be corrupted by its algorithm:
void
|
mongoc_lowercase (const char *src, char *buf /* OUT */)
|
{
|
for (; *src; ++src, ++buf) {
|
*buf = tolower (*src);
|
}
|
}
|
It should probably use bson_utf8_next_char to advance through the string, instead of using "++".