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


test/evp_test.c:1526:1: start of procedure pbe_test_init()
1524.   }
1525.   
1526. > static int pbe_test_init(struct evp_test *t, const char *alg)
1527.   {
1528.       struct pbe_data *pdat;

test/evp_test.c:1529:5: 
1527.   {
1528.       struct pbe_data *pdat;
1529. >     int pbe_type = 0;
1530.   
1531.       if (strcmp(alg, "scrypt") == 0) {

test/evp_test.c:1531:9: Taking false branch
1529.       int pbe_type = 0;
1530.   
1531.       if (strcmp(alg, "scrypt") == 0) {
                ^
1532.   #ifndef OPENSSL_NO_SCRYPT
1533.           pbe_type = PBE_TYPE_SCRYPT;

test/evp_test.c:1538:16: Taking false branch
1536.           return 1;
1537.   #endif
1538.       } else if (strcmp(alg, "pbkdf2") == 0) {
                       ^
1539.           pbe_type = PBE_TYPE_PBKDF2;
1540.       } else if (strcmp(alg, "pkcs12") == 0) {

test/evp_test.c:1540:16: Taking false branch
1538.       } else if (strcmp(alg, "pbkdf2") == 0) {
1539.           pbe_type = PBE_TYPE_PBKDF2;
1540.       } else if (strcmp(alg, "pkcs12") == 0) {
                       ^
1541.           pbe_type = PBE_TYPE_PKCS12;
1542.       } else {

test/evp_test.c:1543:9: 
1541.           pbe_type = PBE_TYPE_PKCS12;
1542.       } else {
1543. >         fprintf(stderr, "Unknown pbe algorithm %s\n", alg);
1544.       }
1545.       pdat = OPENSSL_malloc(sizeof(*pdat));

test/evp_test.c:1545:5: 
1543.           fprintf(stderr, "Unknown pbe algorithm %s\n", alg);
1544.       }
1545. >     pdat = OPENSSL_malloc(sizeof(*pdat));
1546.       pdat->pbe_type = pbe_type;
1547.       pdat->pass = NULL;

crypto/mem.c:71:1: start of procedure CRYPTO_malloc()
  69.   }
  70.   
  71. > void *CRYPTO_malloc(size_t num, const char *file, int line)
  72.   {
  73.       void *ret = NULL;

crypto/mem.c:73:5: 
  71.   void *CRYPTO_malloc(size_t num, const char *file, int line)
  72.   {
  73. >     void *ret = NULL;
  74.   
  75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:75:9: Taking false branch
  73.       void *ret = NULL;
  74.   
  75.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                ^
  76.           return malloc_impl(num, file, line);
  77.   

crypto/mem.c:78:9: Taking false branch
  76.           return malloc_impl(num, file, line);
  77.   
  78.       if (num <= 0)
                ^
  79.           return NULL;
  80.   

crypto/mem.c:81:5: 
  79.           return NULL;
  80.   
  81. >     allow_customize = 0;
  82.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
  83.       if (call_malloc_debug) {

crypto/mem.c:91:5: 
  89.       }
  90.   #else
  91. >     osslargused(file); osslargused(line);
  92.       ret = malloc(num);
  93.   #endif

crypto/mem.c:91:24: 
  89.       }
  90.   #else
  91. >     osslargused(file); osslargused(line);
  92.       ret = malloc(num);
  93.   #endif

crypto/mem.c:92:5: 
  90.   #else
  91.       osslargused(file); osslargused(line);
  92. >     ret = malloc(num);
  93.   #endif
  94.   

crypto/mem.c:95:5: 
  93.   #endif
  94.   
  95. >     return ret;
  96.   }
  97.   

crypto/mem.c:96:1: return from a call to CRYPTO_malloc
  94.   
  95.       return ret;
  96. > }
  97.   
  98.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

test/evp_test.c:1546:5: 
1544.       }
1545.       pdat = OPENSSL_malloc(sizeof(*pdat));
1546. >     pdat->pbe_type = pbe_type;
1547.       pdat->pass = NULL;
1548.       pdat->salt = NULL;
