diff options
author | Jay Satiro <raysatiro@yahoo.com> | 2018-09-12 03:14:20 -0400 |
---|---|---|
committer | Jay Satiro <raysatiro@yahoo.com> | 2018-09-12 03:14:20 -0400 |
commit | 357161accda84cf678c579c652429d529e56db80 (patch) | |
tree | fa46187889f3b313cdd567d8d092db14d9810961 /lib/vtls | |
parent | 11e8a43f853b9bf050db58f073e6f2411821ce60 (diff) |
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
Diffstat (limited to 'lib/vtls')
-rw-r--r-- | lib/vtls/openssl.c | 2 |
1 files changed, 1 insertions, 1 deletions
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'; |