From e0a455e293ddcec3b00564c8d36a3e8e5bc4f09b Mon Sep 17 00:00:00 2001 From: nectar Date: Fri, 2 Feb 2001 13:22:43 +0000 Subject: strcpy -> strlcpy paranoia Submitted by: Mike Heffner Reviewed by: freebsd-audit --- lib/libc/net/hesiod.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/libc') diff --git a/lib/libc/net/hesiod.c b/lib/libc/net/hesiod.c index 2e4ff7d..e28d8a5 100644 --- a/lib/libc/net/hesiod.c +++ b/lib/libc/net/hesiod.c @@ -162,7 +162,10 @@ hesiod_to_bind(void *context, const char *name, const char *type) const char *rhs; int len; - strcpy(bindname, name); + if (strlcpy(bindname, name, sizeof(bindname)) >= sizeof(bindname)) { + errno = EMSGSIZE; + return NULL; + } /* * Find the right right hand side to use, possibly -- cgit v1.1