Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-979

bson_strncpy can abort on Windows

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 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.

      Attachments

        Activity

          People

            jesse@mongodb.com A. Jesse Jiryu Davis
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: