engines/e_ossltest.c:627: error: NULL_DEREFERENCE
  pointer `tmpbuf` last assigned on line 620 could be null and is dereferenced by call to `memcpy()` at line 627, column 5.
Showing all 11 steps of the trace


engines/e_ossltest.c:617:1: start of procedure ossltest_aes128_gcm_cipher()
615.   
616.   
617. > int ossltest_aes128_gcm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
618.                                  const unsigned char *in, size_t inl)
619.   {

engines/e_ossltest.c:620:5: 
618.                                  const unsigned char *in, size_t inl)
619.   {
620. >     unsigned char *tmpbuf = OPENSSL_malloc(inl);
621.   
622.       /* OPENSSL_malloc will return NULL if inl == 0 */

crypto/mem.c:158:1: start of procedure CRYPTO_malloc()
  156.   #endif
  157.   
  158. > void *CRYPTO_malloc(size_t num, const char *file, int line)
  159.   {
  160.       void *ret = NULL;

crypto/mem.c:160:5: 
  158.   void *CRYPTO_malloc(size_t num, const char *file, int line)
  159.   {
  160. >     void *ret = NULL;
  161.   
  162.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:162:9: Taking true branch
  160.       void *ret = NULL;
  161.   
  162.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                 ^
  163.           return malloc_impl(num, file, line);
  164.   

crypto/mem.c:162:32: Taking true branch
  160.       void *ret = NULL;
  161.   
  162.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                                        ^
  163.           return malloc_impl(num, file, line);
  164.   

crypto/mem.c:163:9: Skipping __function_pointer__(): unresolved function pointer
  161.   
  162.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
  163.           return malloc_impl(num, file, line);
                 ^
  164.   
  165.       if (num == 0)

crypto/mem.c:184:1: return from a call to CRYPTO_malloc
  182.   
  183.       return ret;
  184. > }
  185.   
  186.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

engines/e_ossltest.c:623:9: Taking true branch
621.   
622.       /* OPENSSL_malloc will return NULL if inl == 0 */
623.       if (tmpbuf == NULL && inl > 0)
               ^
624.           return -1;
625.   

engines/e_ossltest.c:623:27: Taking false branch
621.   
622.       /* OPENSSL_malloc will return NULL if inl == 0 */
623.       if (tmpbuf == NULL && inl > 0)
                                 ^
624.           return -1;
625.   

engines/e_ossltest.c:627:5: 
625.   
626.       /* Remember what we were asked to encrypt */
627. >     memcpy(tmpbuf, in, inl);
628.   
629.       /* Go through the motions of encrypting it */
