diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-03-13 09:09:52 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-03-13 09:09:52 +0000 |
commit | cd64a50f546ecbfd25035373ee745bd04e4e5905 (patch) | |
tree | 86a1452cec538b8f5259a45745e95cd1161d04e7 /sbin/dump | |
parent | 6153e3b8d9aedd43b1300c4d60217039c9485e02 (diff) |
lots of sprintf -> snprintf and strcpy -> strlcpy; checked by tedu
Diffstat (limited to 'sbin/dump')
-rw-r--r-- | sbin/dump/dumprmt.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sbin/dump/dumprmt.c b/sbin/dump/dumprmt.c index 000d6fb5ca8..8eee75754fd 100644 --- a/sbin/dump/dumprmt.c +++ b/sbin/dump/dumprmt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dumprmt.c,v 1.18 2002/02/21 16:16:26 millert Exp $ */ +/* $OpenBSD: dumprmt.c,v 1.19 2003/03/13 09:09:25 deraadt Exp $ */ /* $NetBSD: dumprmt.c,v 1.17 1997/06/05 16:10:47 mrg Exp $ */ /*- @@ -95,10 +95,11 @@ int rmthost(host) char *host; { + int len = strlen(host) + 1; - rmtpeer = malloc(strlen(host) + 1); + rmtpeer = malloc(len); if (rmtpeer) - strcpy(rmtpeer, host); + strlcpy(rmtpeer, host, len); else rmtpeer = host; signal(SIGPIPE, rmtconnaborted); |