mirror of
https://github.com/openssl/openssl.git
synced 2025-02-17 14:32:04 +08:00
put_str: Use memcpy instead of strncpy
This fixes a warning from latest gcc. There is no point in using strncpy here as we intentionally copy only the string contents without the terminating NUL. The len is set from strlen(). Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> (Merged from https://github.com/openssl/openssl/pull/18627)
This commit is contained in:
parent
e22ea36fa8
commit
5ad3e76c23
@ -600,7 +600,7 @@ static void put_str(const char *str, char **buf, size_t *remain, size_t *needed)
|
||||
len = *remain - 1;
|
||||
|
||||
if (len > 0) {
|
||||
strncpy(*buf, str, len);
|
||||
memcpy(*buf, str, len);
|
||||
*buf += len;
|
||||
*remain -= len;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user