summaryrefslogtreecommitdiffstats
path: root/hack/hack.rip.c
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2009-06-29 23:05:33 +0000
committerdholland <dholland@NetBSD.org>2009-06-29 23:05:33 +0000
commitd00a8d1e94456d45abbb7c94cd846661735277ab (patch)
tree5329ba2218576dbc5e41ed33677391627f69a23a /hack/hack.rip.c
parentfe1c4f849dd6242072352483d84870c6fcc974a7 (diff)
downloadbsdgames-darwin-d00a8d1e94456d45abbb7c94cd846661735277ab.tar.gz
bsdgames-darwin-d00a8d1e94456d45abbb7c94cd846661735277ab.tar.zst
bsdgames-darwin-d00a8d1e94456d45abbb7c94cd846661735277ab.zip
Fix two serious string-handling bugs (one exploitable, one probably
exploitable) and also add proper checking/paranoia in several other places.
Diffstat (limited to 'hack/hack.rip.c')
-rw-r--r--hack/hack.rip.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hack/hack.rip.c b/hack/hack.rip.c
index a27735ee..a0b11671 100644
--- a/hack/hack.rip.c
+++ b/hack/hack.rip.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hack.rip.c,v 1.10 2009/06/07 20:13:18 dholland Exp $ */
+/* $NetBSD: hack.rip.c,v 1.11 2009/06/29 23:05:33 dholland Exp $ */
/*
* Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica,
@@ -63,7 +63,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: hack.rip.c,v 1.10 2009/06/07 20:13:18 dholland Exp $");
+__RCSID("$NetBSD: hack.rip.c,v 1.11 2009/06/29 23:05:33 dholland Exp $");
#endif /* not lint */
#include "hack.h"
@@ -101,7 +101,7 @@ outrip(void)
!strcmp(killer, "starvation") ? "" :
strchr(vowels, *killer) ? " an" : " a");
center(8, buf);
- (void) strcpy(buf, killer);
+ (void) strlcpy(buf, killer, sizeof(buf));
{
int i1;
if ((i1 = strlen(buf)) > 16) {