bson_strncpy can abort on Windows

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

            Assignee:
            A. Jesse Jiryu Davis
            Reporter:
            A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: