Use strlcpy instead of strncpy, pointed out by deraadt.

pull/1/head
Nicholas Marriott 2009-10-26 21:10:24 +00:00
parent 353f2a2ad4
commit 6dc6333323
1 changed files with 3 additions and 2 deletions

View File

@ -29,13 +29,14 @@
char *
xstrdup(const char *s)
{
void *ptr;
char *ptr;
size_t len;
len = strlen(s) + 1;
ptr = xmalloc(len);
return (strncpy(ptr, s, len));
strlcpy(ptr, s, len);
return (ptr);
}
void *