Fix a new gcc-9 warning [-Wstringop-truncation]
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Sat, 23 Jun 2018 20:17:19 +0000 (22:17 +0200)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Sun, 24 Jun 2018 16:05:49 +0000 (18:05 +0200)
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6581)

(cherry picked from commit dc6c374bdb4872f6d5d727e73a2ed834e972842c)

crypto/bio/bss_log.c

index 1283a525b446789ce28537a03c9eddcac077a7b0..69c6e20fc4eaea8dd5daf3bf17811754d53ddef6 100644 (file)
@@ -242,7 +242,7 @@ static int MS_CALLBACK slg_write(BIO *b, const char *in, int inl)
     if ((buf = (char *)OPENSSL_malloc(inl + 1)) == NULL) {
         return (0);
     }
-    strncpy(buf, in, inl);
+    memcpy(buf, in, inl);
     buf[inl] = '\0';
 
     i = 0;