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


test/v3nametest.c:269:1: start of procedure run_cert()
267.   }
268.   
269. > static void run_cert(X509 *crt, const char *nameincert,
270.                        const struct set_name_fn *fn)
271.   {

test/v3nametest.c:272:5: 
270.                        const struct set_name_fn *fn)
271.   {
272. >     const char *const *pname = names;
273.       while (*pname) {
274.           int samename = strcasecmp(nameincert, *pname) == 0;

test/v3nametest.c:273:12: Loop condition is true. Entering loop body
271.   {
272.       const char *const *pname = names;
273.       while (*pname) {
                  ^
274.           int samename = strcasecmp(nameincert, *pname) == 0;
275.           size_t namelen = strlen(*pname);

test/v3nametest.c:274:24: Condition is false
272.       const char *const *pname = names;
273.       while (*pname) {
274.           int samename = strcasecmp(nameincert, *pname) == 0;
                              ^
275.           size_t namelen = strlen(*pname);
276.           char *name = malloc(namelen);

test/v3nametest.c:274:9: 
272.       const char *const *pname = names;
273.       while (*pname) {
274. >         int samename = strcasecmp(nameincert, *pname) == 0;
275.           size_t namelen = strlen(*pname);
276.           char *name = malloc(namelen);

test/v3nametest.c:275:9: 
273.       while (*pname) {
274.           int samename = strcasecmp(nameincert, *pname) == 0;
275. >         size_t namelen = strlen(*pname);
276.           char *name = malloc(namelen);
277.           int match, ret;

test/v3nametest.c:276:9: 
274.           int samename = strcasecmp(nameincert, *pname) == 0;
275.           size_t namelen = strlen(*pname);
276. >         char *name = malloc(namelen);
277.           int match, ret;
278.           memcpy(name, *pname, namelen);

test/v3nametest.c:278:9: 
276.           char *name = malloc(namelen);
277.           int match, ret;
278. >         memcpy(name, *pname, namelen);
279.   
280.           ret = X509_check_host(crt, name, namelen, 0, NULL);
