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:36:32 +0000 (20:36 +0200)
commit62cc845fc955c8d4de7b703f57bfd8e5854f00f4
tree7b2fcf95144b658623154625ad88c75f08c20dfb
parent11dbdc0714b117fcac4af59d61184b0770fcee7e
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)
engines/e_afalg.c