test/v3nametest.c:295: error: NULL_DEREFERENCE
  pointer `name` last assigned on line 292 could be null and is dereferenced by call to `memcpy()` at line 295, column 9.
Showing all 20 steps of the trace


test/v3nametest.c:283:1: start of procedure run_cert()
281.   }
282.   
283. > static int run_cert(X509 *crt, const char *nameincert,
284.                        const struct set_name_fn *fn)
285.   {

test/v3nametest.c:286:5: 
284.                        const struct set_name_fn *fn)
285.   {
286. >     const char *const *pname = names;
287.       int failed = 0;
288.   

test/v3nametest.c:287:5: 
285.   {
286.       const char *const *pname = names;
287. >     int failed = 0;
288.   
289.       for (; *pname != NULL; ++pname) {

test/v3nametest.c:289:12: Loop condition is true. Entering loop body
287.       int failed = 0;
288.   
289.       for (; *pname != NULL; ++pname) {
                  ^
290.           int samename = strcasecmp(nameincert, *pname) == 0;
291.           size_t namelen = strlen(*pname);

test/v3nametest.c:290:24: Condition is false
288.   
289.       for (; *pname != NULL; ++pname) {
290.           int samename = strcasecmp(nameincert, *pname) == 0;
                              ^
291.           size_t namelen = strlen(*pname);
292.           char *name = OPENSSL_malloc(namelen);

test/v3nametest.c:290:9: 
288.   
289.       for (; *pname != NULL; ++pname) {
290. >         int samename = strcasecmp(nameincert, *pname) == 0;
291.           size_t namelen = strlen(*pname);
292.           char *name = OPENSSL_malloc(namelen);

test/v3nametest.c:291:9: 
289.       for (; *pname != NULL; ++pname) {
290.           int samename = strcasecmp(nameincert, *pname) == 0;
291. >         size_t namelen = strlen(*pname);
292.           char *name = OPENSSL_malloc(namelen);
293.           int match, ret;

test/v3nametest.c:292:9: 
290.           int samename = strcasecmp(nameincert, *pname) == 0;
291.           size_t namelen = strlen(*pname);
292. >         char *name = OPENSSL_malloc(namelen);
293.           int match, ret;
294.   

crypto/mem.c:192:1: start of procedure CRYPTO_malloc()
  190.   #endif
  191.   
  192. > void *CRYPTO_malloc(size_t num, const char *file, int line)
  193.   {
  194.       void *ret = NULL;

crypto/mem.c:194:5: 
  192.   void *CRYPTO_malloc(size_t num, const char *file, int line)
  193.   {
  194. >     void *ret = NULL;
  195.   
  196.       INCREMENT(malloc_count);

crypto/mem.c:197:9: Taking true branch
  195.   
  196.       INCREMENT(malloc_count);
  197.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                 ^
  198.           return malloc_impl(num, file, line);
  199.   

crypto/mem.c:197:32: Taking false branch
  195.   
  196.       INCREMENT(malloc_count);
  197.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                                        ^
  198.           return malloc_impl(num, file, line);
  199.   

crypto/mem.c:200:9: Taking false branch
  198.           return malloc_impl(num, file, line);
  199.   
  200.       if (num == 0)
                 ^
  201.           return NULL;
  202.   

crypto/mem.c:204:5: 
  202.   
  203.       FAILTEST();
  204. >     allow_customize = 0;
  205.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
  206.       if (call_malloc_debug) {

crypto/mem.c:214:5: 
  212.       }
  213.   #else
  214. >     (void)(file); (void)(line);
  215.       ret = malloc(num);
  216.   #endif

crypto/mem.c:214:19: 
  212.       }
  213.   #else
  214. >     (void)(file); (void)(line);
  215.       ret = malloc(num);
  216.   #endif

crypto/mem.c:215:5: 
  213.   #else
  214.       (void)(file); (void)(line);
  215. >     ret = malloc(num);
  216.   #endif
  217.   

crypto/mem.c:218:5: 
  216.   #endif
  217.   
  218. >     return ret;
  219.   }
  220.   

crypto/mem.c:219:1: return from a call to CRYPTO_malloc
  217.   
  218.       return ret;
  219. > }
  220.   
  221.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

test/v3nametest.c:295:9: 
293.           int match, ret;
294.   
295. >         memcpy(name, *pname, namelen);
296.   
297.           match = -1;
