crypto/asn1/x_x509.c:109: error: NULL_DEREFERENCE
  pointer `null` is dereferenced by call to `X509_NAME_oneline()` at line 109, column 13.
Showing all 24 steps of the trace


crypto/asn1/x_x509.c:84:1: start of procedure x509_cb()
82.   extern void policy_cache_free(X509_POLICY_CACHE *cache);
83.   
84. > static int x509_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it,
85.   								void *exarg)
86.   {

crypto/asn1/x_x509.c:87:2: 
85.   								void *exarg)
86.   {
87. > 	X509 *ret = (X509 *)*pval;
88.   
89.   	switch(operation) {

crypto/asn1/x_x509.c:89:2: 
87.   	X509 *ret = (X509 *)*pval;
88.   
89. > 	switch(operation) {
90.   
91.   		case ASN1_OP_NEW_POST:

crypto/asn1/x_x509.c:91:3: Switch condition is false. Skipping switch case
89.   	switch(operation) {
90.   
91.   		case ASN1_OP_NEW_POST:
        ^
92.   		ret->valid=0;
93.   		ret->name = NULL;

crypto/asn1/x_x509.c:107:3: Switch condition is true. Entering switch case
105.   		break;
106.   
107.   		case ASN1_OP_D2I_POST:
         ^
108.   		if (ret->name != NULL) OPENSSL_free(ret->name);
109.   		ret->name=X509_NAME_oneline(ret->cert_info->subject,NULL,0);

crypto/asn1/x_x509.c:108:7: Taking true branch
106.   
107.   		case ASN1_OP_D2I_POST:
108.   		if (ret->name != NULL) OPENSSL_free(ret->name);
             ^
109.   		ret->name=X509_NAME_oneline(ret->cert_info->subject,NULL,0);
110.   		break;

crypto/asn1/x_x509.c:108:26: 
106.   
107.   		case ASN1_OP_D2I_POST:
108. > 		if (ret->name != NULL) OPENSSL_free(ret->name);
109.   		ret->name=X509_NAME_oneline(ret->cert_info->subject,NULL,0);
110.   		break;

crypto/mem.c:377:1: start of procedure CRYPTO_free()
  375.   	}
  376.   
  377. > void CRYPTO_free(void *str)
  378.   	{
  379.   	if (free_debug_func != NULL)

crypto/mem.c:379:6: Taking false branch
  377.   void CRYPTO_free(void *str)
  378.   	{
  379.   	if (free_debug_func != NULL)
              ^
  380.   		free_debug_func(str, 0);
  381.   #ifdef LEVITTE_DEBUG_MEM

crypto/mem.c:384:2: Skipping __function_pointer__(): unresolved function pointer
  382.   	fprintf(stderr, "LEVITTE_DEBUG_MEM:         < 0x%p\n", str);
  383.   #endif
  384.   	free_func(str);
          ^
  385.   	if (free_debug_func != NULL)
  386.   		free_debug_func(NULL, 1);

crypto/mem.c:385:6: Taking false branch
  383.   #endif
  384.   	free_func(str);
  385.   	if (free_debug_func != NULL)
              ^
  386.   		free_debug_func(NULL, 1);
  387.   	}

crypto/mem.c:385:2: 
  383.   #endif
  384.   	free_func(str);
  385. > 	if (free_debug_func != NULL)
  386.   		free_debug_func(NULL, 1);
  387.   	}

crypto/mem.c:387:2: return from a call to CRYPTO_free
  385.   	if (free_debug_func != NULL)
  386.   		free_debug_func(NULL, 1);
  387.   	}
          ^
  388.   
  389.   void *CRYPTO_remalloc(void *a, int num, const char *file, int line)

crypto/asn1/x_x509.c:109:3: 
107.   		case ASN1_OP_D2I_POST:
108.   		if (ret->name != NULL) OPENSSL_free(ret->name);
109. > 		ret->name=X509_NAME_oneline(ret->cert_info->subject,NULL,0);
110.   		break;
111.   

crypto/x509/x509_obj.c:66:1: start of procedure X509_NAME_oneline()
  64.   #include <openssl/buffer.h>
  65.   
  66. > char *X509_NAME_oneline(X509_NAME *a, char *buf, int len)
  67.   	{
  68.   	X509_NAME_ENTRY *ne;

crypto/x509/x509_obj.c:74:2: 
  72.   	char *p;
  73.   	unsigned char *q;
  74. > 	BUF_MEM *b=NULL;
  75.   	static char hex[17]="0123456789ABCDEF";
  76.   	int gs_doit[4];

crypto/x509/x509_obj.c:75:2: 
  73.   	unsigned char *q;
  74.   	BUF_MEM *b=NULL;
  75. > 	static char hex[17]="0123456789ABCDEF";
  76.   	int gs_doit[4];
  77.   	char tmp_buf[80];

crypto/x509/x509_obj.c:82:6: Taking false branch
  80.   #endif
  81.   
  82.   	if (buf == NULL)
             ^
  83.   		{
  84.   		if ((b=BUF_MEM_new()) == NULL) goto err;

crypto/x509/x509_obj.c:89:6: Taking true branch
  87.   		len=200;
  88.   		}
  89.   	if (a == NULL)
             ^
  90.   	    {
  91.   	    if(b)

crypto/x509/x509_obj.c:91:9: Taking false branch
  89.   	if (a == NULL)
  90.   	    {
  91.   	    if(b)
                ^
  92.   		{
  93.   		buf=b->data;

crypto/x509/x509_obj.c:96:6: 
  94.   		OPENSSL_free(b);
  95.   		}
  96. > 	    strncpy(buf,"NO X509_NAME",len);
  97.   	    buf[len-1]='\0';
  98.   	    return buf;

crypto/x509/x509_obj.c:97:6: 
  95.   		}
  96.   	    strncpy(buf,"NO X509_NAME",len);
  97. > 	    buf[len-1]='\0';
  98.   	    return buf;
  99.   	    }

crypto/x509/x509_obj.c:98:6: 
  96.   	    strncpy(buf,"NO X509_NAME",len);
  97.   	    buf[len-1]='\0';
  98. > 	    return buf;
  99.   	    }
  100.   

crypto/x509/x509_obj.c:225:2: return from a call to X509_NAME_oneline
  223.   	if (b != NULL) BUF_MEM_free(b);
  224.   	return(NULL);
  225.   	}
          ^
  226.   
