apps/ts.c:1083: error: NULL_DEREFERENCE
  pointer `cert_ctx` last assigned on line 1080 could be null and is dereferenced at line 1083, column 2.
Showing all 20 steps of the trace


apps/ts.c:1073:1: start of procedure create_cert_store()
1071.   	}
1072.   
1073. > static X509_STORE *create_cert_store(char *ca_path, char *ca_file)
1074.   	{
1075.   	X509_STORE *cert_ctx = NULL;

apps/ts.c:1075:2: 
1073.   static X509_STORE *create_cert_store(char *ca_path, char *ca_file)
1074.   	{
1075. > 	X509_STORE *cert_ctx = NULL;
1076.   	X509_LOOKUP *lookup = NULL;
1077.   	int i;

apps/ts.c:1076:2: 
1074.   	{
1075.   	X509_STORE *cert_ctx = NULL;
1076. > 	X509_LOOKUP *lookup = NULL;
1077.   	int i;
1078.   

apps/ts.c:1080:2: 
1078.   
1079.   	/* Creating the X509_STORE object. */
1080. > 	cert_ctx = X509_STORE_new();
1081.   
1082.   	/* Setting the callback for certificate chain verification. */

crypto/x509/x509_lu.c:178:1: start of procedure X509_STORE_new()
  176.   	}
  177.   
  178. > X509_STORE *X509_STORE_new(void)
  179.   	{
  180.   	X509_STORE *ret;

crypto/x509/x509_lu.c:182:6: 
  180.   	X509_STORE *ret;
  181.   
  182. > 	if ((ret=(X509_STORE *)OPENSSL_malloc(sizeof(X509_STORE))) == NULL)
  183.   		return NULL;
  184.   	ret->objs = sk_X509_OBJECT_new(x509_object_cmp);

crypto/mem.c:291:1: start of procedure CRYPTO_malloc()
    289.   	}
    290.   
    291. > void *CRYPTO_malloc(int num, const char *file, int line)
    292.   	{
    293.   	void *ret = NULL;

crypto/mem.c:293:2: 
    291.   void *CRYPTO_malloc(int num, const char *file, int line)
    292.   	{
    293. > 	void *ret = NULL;
    294.   	extern unsigned char cleanse_ctr;
    295.   

crypto/mem.c:296:6: Taking false branch
    294.   	extern unsigned char cleanse_ctr;
    295.   
    296.   	if (num <= 0) return NULL;
                ^
    297.   
    298.   	allow_customize = 0;

crypto/mem.c:298:2: 
    296.   	if (num <= 0) return NULL;
    297.   
    298. > 	allow_customize = 0;
    299.   	if (malloc_debug_func != NULL)
    300.   		{

crypto/mem.c:299:6: Taking false branch
    297.   
    298.   	allow_customize = 0;
    299.   	if (malloc_debug_func != NULL)
                ^
    300.   		{
    301.   		allow_customize_debug = 0;

crypto/mem.c:304:2: Skipping __function_pointer__(): unresolved function pointer
    302.   		malloc_debug_func(NULL, num, file, line, 0);
    303.   		}
    304.   	ret = malloc_ex_func(num,file,line);
            ^
    305.   #ifdef LEVITTE_DEBUG_MEM
    306.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);

crypto/mem.c:308:6: Taking false branch
    306.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         > 0x%p (%d)\n", ret, num);
    307.   #endif
    308.   	if (malloc_debug_func != NULL)
                ^
    309.   		malloc_debug_func(ret, num, file, line, 1);
    310.   

crypto/mem.c:314:12: Taking false branch
    312.            * sanitisation function can't be optimised out. NB: We only do
    313.            * this for >2Kb so the overhead doesn't bother us. */
    314.           if(ret && (num > 2048))
                      ^
    315.                   ((unsigned char *)ret)[0] = cleanse_ctr;
    316.   

crypto/mem.c:317:2: 
    315.                   ((unsigned char *)ret)[0] = cleanse_ctr;
    316.   
    317. > 	return ret;
    318.   	}
    319.   

crypto/mem.c:318:2: return from a call to CRYPTO_malloc
    316.   
    317.   	return ret;
    318.   	}
            ^
    319.   
    320.   void *CRYPTO_realloc(void *str, int num, const char *file, int line)

crypto/x509/x509_lu.c:182:6: Taking true branch
  180.   	X509_STORE *ret;
  181.   
  182.   	if ((ret=(X509_STORE *)OPENSSL_malloc(sizeof(X509_STORE))) == NULL)
              ^
  183.   		return NULL;
  184.   	ret->objs = sk_X509_OBJECT_new(x509_object_cmp);

crypto/x509/x509_lu.c:183:3: 
  181.   
  182.   	if ((ret=(X509_STORE *)OPENSSL_malloc(sizeof(X509_STORE))) == NULL)
  183. > 		return NULL;
  184.   	ret->objs = sk_X509_OBJECT_new(x509_object_cmp);
  185.   	ret->cache=1;

crypto/x509/x509_lu.c:204:2: return from a call to X509_STORE_new
  202.   	ret->references=1;
  203.   	return ret;
  204.   	}
          ^
  205.   
  206.   static void cleanup(X509_OBJECT *a)

apps/ts.c:1083:2: 
1081.   
1082.   	/* Setting the callback for certificate chain verification. */
1083. > 	X509_STORE_set_verify_cb_func(cert_ctx, verify_cb);
1084.   
1085.   	/* Adding a trusted certificate directory source. */
