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


test/v3nametest.c:278:1: start of procedure run_cert()
276.   }
277.   
278. > static void 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.       while (*pname) {
283.           int samename = strcasecmp(nameincert, *pname) == 0;

test/v3nametest.c:282:12: Loop condition is true. Entering loop body
280.   {
281.       const char *const *pname = names;
282.       while (*pname) {
                  ^
283.           int samename = strcasecmp(nameincert, *pname) == 0;
284.           size_t namelen = strlen(*pname);

test/v3nametest.c:283:24: Condition is false
281.       const char *const *pname = names;
282.       while (*pname) {
283.           int samename = strcasecmp(nameincert, *pname) == 0;
                              ^
284.           size_t namelen = strlen(*pname);
285.           char *name = malloc(namelen);

test/v3nametest.c:283:9: 
281.       const char *const *pname = names;
282.       while (*pname) {
283. >         int samename = strcasecmp(nameincert, *pname) == 0;
284.           size_t namelen = strlen(*pname);
285.           char *name = malloc(namelen);

test/v3nametest.c:284:9: 
282.       while (*pname) {
283.           int samename = strcasecmp(nameincert, *pname) == 0;
284. >         size_t namelen = strlen(*pname);
285.           char *name = malloc(namelen);
286.           int match, ret;

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

test/v3nametest.c:287:9: 
285.           char *name = malloc(namelen);
286.           int match, ret;
287. >         memcpy(name, *pname, namelen);
288.   
289.           ret = X509_check_host(crt, name, namelen, 0, NULL);
