Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-5]: src/lib/libc/net Pull up revision 1.16 (requested by he):
details: https://anonhg.NetBSD.org/src/rev/d46640396b3f
branches: netbsd-1-5
changeset: 493064:d46640396b3f
user: he <he%NetBSD.org@localhost>
date: Wed Apr 17 11:51:18 2002 +0000
description:
Pull up revision 1.16 (requested by he):
Replace strcpy() with strlcpy() and bounds check.
diffstat:
lib/libc/net/hesiod.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diffs (30 lines):
diff -r aff31a42ba2a -r d46640396b3f lib/libc/net/hesiod.c
--- a/lib/libc/net/hesiod.c Wed Apr 17 11:46:02 2002 +0000
+++ b/lib/libc/net/hesiod.c Wed Apr 17 11:51:18 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hesiod.c,v 1.13.2.1 2000/11/01 22:45:45 tv Exp $ */
+/* $NetBSD: hesiod.c,v 1.13.2.2 2002/04/17 11:51:18 he Exp $ */
/* Copyright (c) 1996 by Internet Software Consortium.
*
@@ -52,7 +52,7 @@
"#Id: hesiod_p.h,v 1.1 1996/12/08 21:39:37 ghudson Exp #");
__IDSTRING(rcsid_hescompat_c,
"#Id: hescompat.c,v 1.1.2.1 1996/12/16 08:37:45 ghudson Exp #");
-__RCSID("$NetBSD: hesiod.c,v 1.13.2.1 2000/11/01 22:45:45 tv Exp $");
+__RCSID("$NetBSD: hesiod.c,v 1.13.2.2 2002/04/17 11:51:18 he Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@@ -198,7 +198,10 @@
_DIAGASSERT(name != NULL);
_DIAGASSERT(type != NULL);
- strcpy(bindname, name);
+ if (strlcpy(bindname, name, sizeof(bindname)) >= sizeof(bindname)) {
+ errno = EMSGSIZE;
+ return NULL;
+ }
/*
* Find the right right hand side to use, possibly
Home |
Main Index |
Thread Index |
Old Index