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


crypto/x509v3/v3nametest.c:259:1: start of procedure run_cert()
257.   }
258.   
259. > static void run_cert(X509 *crt, const char *nameincert,
260.                        const struct set_name_fn *fn)
261.   {

crypto/x509v3/v3nametest.c:262:5: 
260.                        const struct set_name_fn *fn)
261.   {
262. >     const char *const *pname = names;
263.       while (*pname) {
264.           int samename = strcasecmp(nameincert, *pname) == 0;

crypto/x509v3/v3nametest.c:263:12: Loop condition is true. Entering loop body
261.   {
262.       const char *const *pname = names;
263.       while (*pname) {
                  ^
264.           int samename = strcasecmp(nameincert, *pname) == 0;
265.           size_t namelen = strlen(*pname);

crypto/x509v3/v3nametest.c:264:24: Condition is false
262.       const char *const *pname = names;
263.       while (*pname) {
264.           int samename = strcasecmp(nameincert, *pname) == 0;
                              ^
265.           size_t namelen = strlen(*pname);
266.           char *name = malloc(namelen);

crypto/x509v3/v3nametest.c:264:9: 
262.       const char *const *pname = names;
263.       while (*pname) {
264. >         int samename = strcasecmp(nameincert, *pname) == 0;
265.           size_t namelen = strlen(*pname);
266.           char *name = malloc(namelen);

crypto/x509v3/v3nametest.c:265:9: 
263.       while (*pname) {
264.           int samename = strcasecmp(nameincert, *pname) == 0;
265. >         size_t namelen = strlen(*pname);
266.           char *name = malloc(namelen);
267.           int match, ret;

crypto/x509v3/v3nametest.c:266:9: 
264.           int samename = strcasecmp(nameincert, *pname) == 0;
265.           size_t namelen = strlen(*pname);
266. >         char *name = malloc(namelen);
267.           int match, ret;
268.           memcpy(name, *pname, namelen);

crypto/x509v3/v3nametest.c:268:9: 
266.           char *name = malloc(namelen);
267.           int match, ret;
268. >         memcpy(name, *pname, namelen);
269.   
270.           ret = X509_check_host(crt, name, namelen, 0, NULL);
