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


test/v3nametest.c:278:1: start of procedure run_cert()
276.   }
277.   
278. > static int run_cert(X509 *crt, const char *nameincert,
279.                        const struct set_name_fn *fn)
280.   {

test/v3nametest.c:281:5: 
279.                        const struct set_name_fn *fn)
280.   {
281. >     const char *const *pname = names;
282.       int failed = 0;
283.   

test/v3nametest.c:282:5: 
280.   {
281.       const char *const *pname = names;
282. >     int failed = 0;
283.   
284.       for (; *pname != NULL; ++pname) {

test/v3nametest.c:284:12: Loop condition is true. Entering loop body
282.       int failed = 0;
283.   
284.       for (; *pname != NULL; ++pname) {
                  ^
285.           int samename = strcasecmp(nameincert, *pname) == 0;
286.           size_t namelen = strlen(*pname);

test/v3nametest.c:285:24: Condition is false
283.   
284.       for (; *pname != NULL; ++pname) {
285.           int samename = strcasecmp(nameincert, *pname) == 0;
                              ^
286.           size_t namelen = strlen(*pname);
287.           char *name = OPENSSL_malloc(namelen);

test/v3nametest.c:285:9: 
283.   
284.       for (; *pname != NULL; ++pname) {
285. >         int samename = strcasecmp(nameincert, *pname) == 0;
286.           size_t namelen = strlen(*pname);
287.           char *name = OPENSSL_malloc(namelen);

test/v3nametest.c:286:9: 
284.       for (; *pname != NULL; ++pname) {
285.           int samename = strcasecmp(nameincert, *pname) == 0;
286. >         size_t namelen = strlen(*pname);
287.           char *name = OPENSSL_malloc(namelen);
288.           int match, ret;

test/v3nametest.c:287:9: 
285.           int samename = strcasecmp(nameincert, *pname) == 0;
286.           size_t namelen = strlen(*pname);
287. >         char *name = OPENSSL_malloc(namelen);
288.           int match, ret;
289.   

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

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

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

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

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

crypto/mem.c:201:5: 
  199.   
  200.       FAILTEST();
  201. >     allow_customize = 0;
  202.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
  203.       if (call_malloc_debug) {

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

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

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

crypto/mem.c:215:5: 
  213.   #endif
  214.   
  215. >     return ret;
  216.   }
  217.   

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

test/v3nametest.c:290:9: 
288.           int match, ret;
289.   
290. >         memcpy(name, *pname, namelen);
291.   
292.           match = -1;
