Fix a gcc warning about possible null pointer
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Sun, 3 Nov 2019 18:36:11 +0000 (19:36 +0100)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Fri, 3 Apr 2020 10:57:37 +0000 (12:57 +0200)
commite2bf331bc0c735ebd8d9b86725bc3dc32245f986
tree5acf2dbad5a70f5980fd9229d349b361bff35f1c
parent70d80ef9898ddbe03841efd2df2f526b71829d7f
Fix a gcc warning about possible null pointer

In function 'ccm_tls_cipher',
    inlined from 'ccm_cipher_internal' at providers/common/ciphers/cipher_ccm.c:359:16,
    inlined from 'ccm_stream_final' at providers/common/ciphers/cipher_ccm.c:265:9:
providers/common/ciphers/cipher_ccm.c:317:5: error: argument 2 null where non-null expected [-Werror=nonnull]
  317 |     memcpy(ctx->iv + EVP_CCM_TLS_FIXED_IV_LEN, in, EVP_CCM_TLS_EXPLICIT_IV_LEN);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/internal/cryptlib.h:14,
                 from providers/common/include/prov/ciphercommon.h:14,
                 from providers/common/ciphers/cipher_ccm.c:12:
providers/common/ciphers/cipher_ccm.c: In function 'ccm_stream_final':
/home/ed/gnu/arm-linux-gnueabihf-linux64/arm-linux-gnueabihf/sys-include/string.h:44:14: note: in a call to function 'memcpy' declared here
   44 | extern void *memcpy (void *__restrict __dest,
      |              ^~~~~~

[extended tests]

Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/10344)
providers/implementations/ciphers/ciphercommon_ccm.c