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:169:1: start of procedure CRYPTO_malloc()
  167.   #endif
  168.   
  169. > void *CRYPTO_malloc(size_t num, const char *file, int line)
  170.   {
  171.       void *ret = NULL;

crypto/mem.c:171:5: 
  169.   void *CRYPTO_malloc(size_t num, const char *file, int line)
  170.   {
  171. >     void *ret = NULL;
  172.   
  173.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:173:9: Taking true branch
  171.       void *ret = NULL;
  172.   
  173.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                 ^
  174.           return malloc_impl(num, file, line);
  175.   

crypto/mem.c:173:32: Taking false branch
  171.       void *ret = NULL;
  172.   
  173.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                                        ^
  174.           return malloc_impl(num, file, line);
  175.   

crypto/mem.c:176:9: Taking false branch
  174.           return malloc_impl(num, file, line);
  175.   
  176.       if (num == 0)
                 ^
  177.           return NULL;
  178.   

crypto/mem.c:180:5: 
  178.   
  179.       FAILTEST();
  180. >     allow_customize = 0;
  181.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
  182.       if (call_malloc_debug) {

crypto/mem.c:190:5: 
  188.       }
  189.   #else
  190. >     (void)(file); (void)(line);
  191.       ret = malloc(num);
  192.   #endif

crypto/mem.c:190:19: 
  188.       }
  189.   #else
  190. >     (void)(file); (void)(line);
  191.       ret = malloc(num);
  192.   #endif

crypto/mem.c:191:5: 
  189.   #else
  190.       (void)(file); (void)(line);
  191. >     ret = malloc(num);
  192.   #endif
  193.   

crypto/mem.c:194:5: 
  192.   #endif
  193.   
  194. >     return ret;
  195.   }
  196.   

crypto/mem.c:195:1: return from a call to CRYPTO_malloc
  193.   
  194.       return ret;
  195. > }
  196.   
  197.   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;
