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


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

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

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

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

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

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

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

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

crypto/mem.c:158:1: start of procedure CRYPTO_malloc()
  156.   #endif
  157.   
  158. > void *CRYPTO_malloc(size_t num, const char *file, int line)
  159.   {
  160.       void *ret = NULL;

crypto/mem.c:160:5: 
  158.   void *CRYPTO_malloc(size_t num, const char *file, int line)
  159.   {
  160. >     void *ret = NULL;
  161.   
  162.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)

crypto/mem.c:162:9: Taking true branch
  160.       void *ret = NULL;
  161.   
  162.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                 ^
  163.           return malloc_impl(num, file, line);
  164.   

crypto/mem.c:162:32: Taking false branch
  160.       void *ret = NULL;
  161.   
  162.       if (malloc_impl != NULL && malloc_impl != CRYPTO_malloc)
                                        ^
  163.           return malloc_impl(num, file, line);
  164.   

crypto/mem.c:165:9: Taking false branch
  163.           return malloc_impl(num, file, line);
  164.   
  165.       if (num == 0)
                 ^
  166.           return NULL;
  167.   

crypto/mem.c:169:5: 
  167.   
  168.       FAILTEST();
  169. >     allow_customize = 0;
  170.   #ifndef OPENSSL_NO_CRYPTO_MDEBUG
  171.       if (call_malloc_debug) {

crypto/mem.c:179:5: 
  177.       }
  178.   #else
  179. >     osslargused(file); osslargused(line);
  180.       ret = malloc(num);
  181.   #endif

crypto/mem.c:179:24: 
  177.       }
  178.   #else
  179. >     osslargused(file); osslargused(line);
  180.       ret = malloc(num);
  181.   #endif

crypto/mem.c:180:5: 
  178.   #else
  179.       osslargused(file); osslargused(line);
  180. >     ret = malloc(num);
  181.   #endif
  182.   

crypto/mem.c:183:5: 
  181.   #endif
  182.   
  183. >     return ret;
  184.   }
  185.   

crypto/mem.c:184:1: return from a call to CRYPTO_malloc
  182.   
  183.       return ret;
  184. > }
  185.   
  186.   void *CRYPTO_zalloc(size_t num, const char *file, int line)

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