diff options
Diffstat (limited to 'usr.sbin/route6d')
-rw-r--r-- | usr.sbin/route6d/route6d.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.sbin/route6d/route6d.c b/usr.sbin/route6d/route6d.c index d69301c..6d7fddd 100644 --- a/usr.sbin/route6d/route6d.c +++ b/usr.sbin/route6d/route6d.c @@ -3261,9 +3261,15 @@ char * allocopy(p) char *p; { - char *q = (char *)malloc(strlen(p) + 1); + int len = strlen(p) + 1; + char *q = (char *)malloc(len); - strcpy(q, p); + if (!q) { + fatal("malloc"); + /*NOTREACHED*/ + } + + strlcpy(q, p, len); return q; } |