test/evp_test.c:1637: error: NULL_DEREFERENCE
  pointer `pdat` last assigned on line 1636 could be null and is dereferenced at line 1637, column 5.
Showing all 18 steps of the trace


test/evp_test.c:1617:1: start of procedure pbe_test_init()
1615.   }
1616.   
1617. > static int pbe_test_init(struct evp_test *t, const char *alg)
1618.   {
1619.       struct pbe_data *pdat;

test/evp_test.c:1620:5: 
1618.   {
1619.       struct pbe_data *pdat;
1620. >     int pbe_type = 0;
1621.   
1622.       if (strcmp(alg, "scrypt") == 0) {

test/evp_test.c:1622:9: Taking false branch
1620.       int pbe_type = 0;
1621.   
1622.       if (strcmp(alg, "scrypt") == 0) {
                ^
1623.   #ifndef OPENSSL_NO_SCRYPT
1624.           pbe_type = PBE_TYPE_SCRYPT;

test/evp_test.c:1629:16: Taking false branch
1627.           return 1;
1628.   #endif
1629.       } else if (strcmp(alg, "pbkdf2") == 0) {
                       ^
1630.           pbe_type = PBE_TYPE_PBKDF2;
1631.       } else if (strcmp(alg, "pkcs12") == 0) {

test/evp_test.c:1631:16: Taking false branch
1629.       } else if (strcmp(alg, "pbkdf2") == 0) {
1630.           pbe_type = PBE_TYPE_PBKDF2;
1631.       } else if (strcmp(alg, "pkcs12") == 0) {
                       ^
1632.           pbe_type = PBE_TYPE_PKCS12;
1633.       } else {

test/evp_test.c:1634:9: 
1632.           pbe_type = PBE_TYPE_PKCS12;
1633.       } else {
1634. >         fprintf(stderr, "Unknown pbe algorithm %s\n", alg);
1635.       }
1636.       pdat = OPENSSL_malloc(sizeof(*pdat));

test/evp_test.c:1636:5: 
1634.           fprintf(stderr, "Unknown pbe algorithm %s\n", alg);
1635.       }
1636. >     pdat = OPENSSL_malloc(sizeof(*pdat));
1637.       pdat->pbe_type = pbe_type;
1638.       pdat->pass = NULL;

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

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

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

crypto/mem.c:164:9: Taking false branch
  162.           return malloc_impl(num, file, line);
  163.   
  164.       if (num <= 0)
                 ^
  165.           return NULL;
  166.   

crypto/mem.c:168:5: 
  166.   
  167.       FAILTEST();
  168. >     allow_customize = 0;
  169.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
  170.       if (call_malloc_debug) {

crypto/mem.c:178:5: 
  176.       }
  177.   #else
  178. >     osslargused(file); osslargused(line);
  179.       ret = malloc(num);
  180.   #endif

crypto/mem.c:178:24: 
  176.       }
  177.   #else
  178. >     osslargused(file); osslargused(line);
  179.       ret = malloc(num);
  180.   #endif

crypto/mem.c:179:5: 
  177.   #else
  178.       osslargused(file); osslargused(line);
  179. >     ret = malloc(num);
  180.   #endif
  181.   

crypto/mem.c:182:5: 
  180.   #endif
  181.   
  182. >     return ret;
  183.   }
  184.   

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

test/evp_test.c:1637:5: 
1635.       }
1636.       pdat = OPENSSL_malloc(sizeof(*pdat));
1637. >     pdat->pbe_type = pbe_type;
1638.       pdat->pass = NULL;
1639.       pdat->salt = NULL;
