crypto/x509v3/v3nametest.c:276: error: NULL_DEREFERENCE
  pointer `name` last assigned on line 274 could be null and is dereferenced by call to `memcpy()` at line 276, column 3.
Showing all 8 steps of the trace


crypto/x509v3/v3nametest.c:266:1: start of procedure run_cert()
264.   	}
265.   
266. > static void run_cert(X509 *crt, const char *nameincert,
267.   		     const struct set_name_fn *fn)
268.   	{

crypto/x509v3/v3nametest.c:269:2: 
267.   		     const struct set_name_fn *fn)
268.   	{
269. > 	const char *const *pname = names;
270.   	while (*pname)
271.   		{

crypto/x509v3/v3nametest.c:270:9: Loop condition is true. Entering loop body
268.   	{
269.   	const char *const *pname = names;
270.   	while (*pname)
               ^
271.   		{
272.   		int samename = strcasecmp(nameincert, *pname) == 0;

crypto/x509v3/v3nametest.c:272:18: Condition is false
270.   	while (*pname)
271.   		{
272.   		int samename = strcasecmp(nameincert, *pname) == 0;
                        ^
273.   		size_t namelen = strlen(*pname);
274.   		char *name = malloc(namelen);

crypto/x509v3/v3nametest.c:272:3: 
270.   	while (*pname)
271.   		{
272. > 		int samename = strcasecmp(nameincert, *pname) == 0;
273.   		size_t namelen = strlen(*pname);
274.   		char *name = malloc(namelen);

crypto/x509v3/v3nametest.c:273:3: 
271.   		{
272.   		int samename = strcasecmp(nameincert, *pname) == 0;
273. > 		size_t namelen = strlen(*pname);
274.   		char *name = malloc(namelen);
275.   		int match, ret;

crypto/x509v3/v3nametest.c:274:3: 
272.   		int samename = strcasecmp(nameincert, *pname) == 0;
273.   		size_t namelen = strlen(*pname);
274. > 		char *name = malloc(namelen);
275.   		int match, ret;
276.   		memcpy(name, *pname, namelen);

crypto/x509v3/v3nametest.c:276:3: 
274.   		char *name = malloc(namelen);
275.   		int match, ret;
276. > 		memcpy(name, *pname, namelen);
277.   
278.   		ret = X509_check_host(crt, name, namelen, 0, NULL);
