if (p < retryname)
abort (); /* XXX write this right if this ever happens */
if (p > retryname)
- strcpy (retryname, p);
+ memmove (retryname, p, strlen(p) + 1);
startdir = *result;
}
else
case '/':
if (err = opentty (&startdir))
goto out;
- strcpy (retryname, &retryname[4]);
+ memmove (retryname, &retryname[4], strlen(retryname + 4) + 1);
break;
default:
goto bad_magic;
p = _itoa (__getpid (), &buf[sizeof buf], 10, 0);
len = &buf[sizeof buf] - p;
memcpy (buf, p, len);
- strcpy (buf + len, &retryname[3]);
+ strncpy (buf + len, &retryname[3], sizeof buf - len - 1);
+ buf[sizeof buf - 1] = '\0';
strcpy (retryname, buf);
/* Do a normal retry on the remaining components. */