From: Jay Satiro Date: Wed, 12 Sep 2018 07:14:20 +0000 (-0400) Subject: openssl: fix gcc8 warning X-Git-Tag: curl-7_62_0~197 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=357161accda84cf678c579c652429d529e56db80;p=curl 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 --- 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';