Details
-
Bug
-
Resolution: Done
-
Major - P3
-
None
-
None
-
None
-
None
Description
On platforms where bson_strncpy can call strncpy, if the destination is too small to copy the whole string, bson_strncpy truncates it to fit. On Windows it calls strcpy_s, which aborts the program if the source string is too long.
On Windows bson_strncpy should call strncpy_s (with an "n") instead, which accepts a "_TRUNCATE" option that behaves like standard strncpy.