summaryrefslogtreecommitdiffstats
path: root/crypto/property
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2022-06-22 12:36:02 +0200
committerTomas Mraz <tomas@openssl.org>2022-06-23 15:44:19 +0200
commit5ad3e76c23576b2e216463bfe43d005a3e09defc (patch)
treec7d3c3606f947eb4466af8cdfdfcb66cc1e62c77 /crypto/property
parentFix the checks of X509_LOOKUP_* functions (diff)
downloadopenssl-5ad3e76c23576b2e216463bfe43d005a3e09defc.tar.xz
openssl-5ad3e76c23576b2e216463bfe43d005a3e09defc.zip
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)
Diffstat (limited to 'crypto/property')
-rw-r--r--crypto/property/property_parse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/property/property_parse.c b/crypto/property/property_parse.c
index cdfe477735..b2bf3cd631 100644
--- a/crypto/property/property_parse.c
+++ b/crypto/property/property_parse.c
@@ -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;
}