[CDRIVER-979] bson_strncpy can abort on Windows Created: 01/Nov/15 Updated: 03/May/17 Resolved: 03/Nov/15 |
|
| Status: | Closed |
| Project: | C Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | A. Jesse Jiryu Davis | Assignee: | A. Jesse Jiryu Davis |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| 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. |
| Comments |
| Comment by Githook User [ 03/Nov/15 ] |
|
Author: {u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}Message: On platforms where bson_strncpy can call strncpy, if the destination is too On Windows bson_strncpy should call strncpy_s (with an "n") instead, which |