crypto/x509v3/v3_ia5.c:99: error: NULL_DEREFERENCE
  pointer `tmp` last assigned on line 98 could be null and is dereferenced by call to `memcpy()` at line 99, column 2.
Showing all 5 steps of the trace


crypto/x509v3/v3_ia5.c:93:1: start of procedure i2s_ASN1_IA5STRING()
91.   }
92.   
93. > static char *i2s_ASN1_IA5STRING(X509V3_EXT_METHOD *method,
94.   	     ASN1_IA5STRING *ia5)
95.   {

crypto/x509v3/v3_ia5.c:97:6: Taking false branch
95.   {
96.   	char *tmp;
97.   	if(!ia5 || !ia5->length) return NULL;
            ^
98.   	tmp = Malloc(ia5->length + 1);
99.   	memcpy(tmp, ia5->data, ia5->length);

crypto/x509v3/v3_ia5.c:97:14: Taking false branch
95.   {
96.   	char *tmp;
97.   	if(!ia5 || !ia5->length) return NULL;
                    ^
98.   	tmp = Malloc(ia5->length + 1);
99.   	memcpy(tmp, ia5->data, ia5->length);

crypto/x509v3/v3_ia5.c:98:2: 
96.   	char *tmp;
97.   	if(!ia5 || !ia5->length) return NULL;
98. > 	tmp = Malloc(ia5->length + 1);
99.   	memcpy(tmp, ia5->data, ia5->length);
100.   	tmp[ia5->length] = 0;

crypto/x509v3/v3_ia5.c:99:2: 
97.   	if(!ia5 || !ia5->length) return NULL;
98.   	tmp = Malloc(ia5->length + 1);
99. > 	memcpy(tmp, ia5->data, ia5->length);
100.   	tmp[ia5->length] = 0;
101.   	return tmp;

static char *i2s_ASN1_IA5STRING(X509V3_EXT_METHOD *method,
	     ASN1_IA5STRING *ia5)
{
	char *tmp;
	if(!ia5 || !ia5->length) return NULL;
	tmp = Malloc(ia5->length + 1);
	memcpy(tmp, ia5->data, ia5->length);
	tmp[ia5->length] = 0;
	return tmp;
}
['static char *i2s_ASN1_IA5STRING(X509V3_EXT_METHOD *method,\n\t     ASN1_IA5STRING *ia5)\n{\n\tchar *tmp;\n\tif(!ia5 || !ia5->length) return NULL;\n\ttmp = Malloc(ia5->length + 1);\n\tmemcpy(tmp, ia5->data, ia5->length);\n\ttmp[ia5->length] = 0;\n\treturn tmp;\n}']