mirror of
https://github.com/curl/curl.git
synced 2026-04-11 12:01:42 +08:00
version: use msnprintf instead of strncpy
- to ensure a terminating null byte - to avoid zero-padding the target debug code only Closes #13549
This commit is contained in:
parent
cd3463d99e
commit
7c8970e95f
@ -175,8 +175,7 @@ char *curl_version(void)
|
||||
/* Override version string when environment variable CURL_VERSION is set */
|
||||
const char *debugversion = getenv("CURL_VERSION");
|
||||
if(debugversion) {
|
||||
strncpy(out, debugversion, sizeof(out)-1);
|
||||
out[sizeof(out)-1] = '\0';
|
||||
msnprintf(out, sizeof(out), "%s", debugversion);
|
||||
return out;
|
||||
}
|
||||
#endif
|
||||
|
||||
Loading…
Reference in New Issue
Block a user