aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Vidrine <nectar@FreeBSD.org>2001-02-02 13:22:43 +0000
committerJacques Vidrine <nectar@FreeBSD.org>2001-02-02 13:22:43 +0000
commite31b3502a1a6b1f5a8d110f8001a1b8952a0b423 (patch)
treece62c1a709d78727f7943f31725609650bb350c3
parent4d5a3a7a500e7c194299e6a9873864d8c4774269 (diff)
downloadsrc-e31b3502a1a6b1f5a8d110f8001a1b8952a0b423.tar.gz
src-e31b3502a1a6b1f5a8d110f8001a1b8952a0b423.zip
strcpy -> strlcpy paranoia
Submitted by: Mike Heffner <mheffner@vt.edu> Reviewed by: freebsd-audit
Notes
Notes: svn path=/head/; revision=71929
-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 2e4ff7df7262..e28d8a56d83c 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