Use OPENSSL_strlcpy instead of strncpy in e_afalg.c
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Mon, 29 Jul 2019 09:39:34 +0000 (11:39 +0200)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Tue, 30 Jul 2019 18:38:50 +0000 (20:38 +0200)
commit74f4cc0276b8fe003c036544219a0371266fc32c
tree6e541e45c6d2406393699b7f948f3633303fdd8c
parent7de305510a07729be3cc80a0fb10561732ee4f31
Use OPENSSL_strlcpy instead of strncpy in e_afalg.c

This avoids a spurious gcc warning:
./config enable-asan --strict-warnings
=>
In function 'afalg_create_sk',
    inlined from 'afalg_cipher_init' at engines/e_afalg.c:545:11:
engines/e_afalg.c:376:5: error: '__builtin_strncpy' output may be
    truncated copying 63 bytes from a string of length 63 [-Werror=stringop-truncation]
  376 |     strncpy((char *) sa.salg_name, ciphername, ALG_MAX_SALG_NAME);
      |     ^~~~~~~

[extended tests]

Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/9478)

(cherry picked from commit 62cc845fc955c8d4de7b703f57bfd8e5854f00f4)
engines/e_afalg.c