mirror of
https://github.com/curl/curl.git
synced 2026-05-15 11:46:22 +03:00
Replace: - curl_sspi: macro `_tcsncpy()` with `_tcsncpy_s()`. - curlx/fopen: `wcsncpy()` with `wcsncpy_s()`. - curlx/fopen: `wcscpy()` with `wcscpy_s()`. Use of the pre-existing functions were safe. This patch aims to use the recommended Windows CRT functions. Handle errors returned by them. Also to avoid the compiler warnings silenced via `_CRT_SECURE_NO_WARNINGS`: ``` lib/curl_sspi.c(152): warning C4996: 'wcsncpy': This function or variable may be unsafe. Consider using wcsncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. lib/curlx/fopen.c(161): warning C4996: 'wcsncpy': This function or variable may be unsafe. Consider using wcsncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. lib/curlx/fopen.c(162): warning C4996: 'wcscpy': This function or variable may be unsafe. Consider using wcscpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. lib/curlx/fopen.c(174): warning C4996: 'wcsncpy': This function or variable may be unsafe. Consider using wcsncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. lib/curlx/fopen.c(175): warning C4996: 'wcscpy': This function or variable may be unsafe. Consider using wcscpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. ``` Refs: https://learn.microsoft.com/cpp/c-runtime-library/reference/strncpy-strncpy-l-wcsncpy-wcsncpy-l-mbsncpy-mbsncpy-l https://learn.microsoft.com/cpp/c-runtime-library/reference/strncpy-s-strncpy-s-l-wcsncpy-s-wcsncpy-s-l-mbsncpy-s-mbsncpy-s-l https://learn.microsoft.com/cpp/c-runtime-library/security-features-in-the-crt Cherry-picked from #19581 (in part) Closes #19589 |
||
|---|---|---|
| .. | ||
| base64.c | ||
| base64.h | ||
| binmode.h | ||
| curlx.h | ||
| dynbuf.c | ||
| dynbuf.h | ||
| fopen.c | ||
| fopen.h | ||
| inet_ntop.c | ||
| inet_ntop.h | ||
| inet_pton.c | ||
| inet_pton.h | ||
| multibyte.c | ||
| multibyte.h | ||
| nonblock.c | ||
| nonblock.h | ||
| strerr.c | ||
| strerr.h | ||
| strparse.c | ||
| strparse.h | ||
| timediff.c | ||
| timediff.h | ||
| timeval.c | ||
| timeval.h | ||
| version_win32.c | ||
| version_win32.h | ||
| wait.c | ||
| wait.h | ||
| warnless.c | ||
| warnless.h | ||
| winapi.c | ||
| winapi.h | ||