summaryrefslogtreecommitdiffstats
path: root/lib/libc/net/hesiod.c
diff options
context:
space:
mode:
authornectar <nectar@FreeBSD.org>2001-02-02 13:22:43 +0000
committernectar <nectar@FreeBSD.org>2001-02-02 13:22:43 +0000
commite0a455e293ddcec3b00564c8d36a3e8e5bc4f09b (patch)
treecfc60ecf4c2084c9d71a472089991a54eeb7d0dd /lib/libc/net/hesiod.c
parent3d2911409aea07101b1065123f52dc731a093d74 (diff)
downloadFreeBSD-src-e0a455e293ddcec3b00564c8d36a3e8e5bc4f09b.zip
FreeBSD-src-e0a455e293ddcec3b00564c8d36a3e8e5bc4f09b.tar.gz
strcpy -> strlcpy paranoia
Submitted by: Mike Heffner <mheffner@vt.edu> Reviewed by: freebsd-audit
Diffstat (limited to 'lib/libc/net/hesiod.c')
-rw-r--r--lib/libc/net/hesiod.c5
1 files changed, 4 insertions, 1 deletions
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
OpenPOWER on IntegriCloud