From 357161accda84cf678c579c652429d529e56db80 Mon Sep 17 00:00:00 2001 From: Jay Satiro Date: Wed, 12 Sep 2018 03:14:20 -0400 Subject: openssl: fix gcc8 warning - Use memcpy instead of strncpy to copy a string without termination, since gcc8 warns about using strncpy to copy as many bytes from a string as its length. Suggested-by: Viktor Szakats Closes https://github.com/curl/curl/issues/2980 --- lib/vtls/openssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index d257d9490..a9ba33038 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -253,7 +253,7 @@ static void ossl_keylog_callback(const SSL *ssl, const char *line) if(!buf) return; } - strncpy(buf, line, linelen); + memcpy(buf, line, linelen); buf[linelen] = '\n'; buf[linelen + 1] = '\0'; -- cgit v1.2.3