summaryrefslogtreecommitdiff
path: root/usr.bin/oldrdist
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-07-08 20:49:12 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-07-08 20:49:12 +0000
commit4a325f8481a83c10598abc934b5bd7884e8c2061 (patch)
tree754cae25ae812de287d7e47a3ac27d0811935b24 /usr.bin/oldrdist
parent0353ca5ca22af198d4637198df9d25140d504cd2 (diff)
8lgm#26, buffer overflow
Diffstat (limited to 'usr.bin/oldrdist')
-rw-r--r--usr.bin/oldrdist/lookup.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.bin/oldrdist/lookup.c b/usr.bin/oldrdist/lookup.c
index 1fbc1b2b0e6..0048426a9b7 100644
--- a/usr.bin/oldrdist/lookup.c
+++ b/usr.bin/oldrdist/lookup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lookup.c,v 1.2 1996/06/26 05:37:39 deraadt Exp $ */
+/* $OpenBSD: lookup.c,v 1.3 1996/07/08 20:49:11 deraadt Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -35,7 +35,7 @@
#ifndef lint
/* from: static char sccsid[] = "@(#)lookup.c 8.1 (Berkeley) 6/9/93"; */
-static char *rcsid = "$OpenBSD: lookup.c,v 1.2 1996/06/26 05:37:39 deraadt Exp $";
+static char *rcsid = "$OpenBSD: lookup.c,v 1.3 1996/07/08 20:49:11 deraadt Exp $";
#endif /* not lint */
#include "defs.h"
@@ -129,7 +129,7 @@ lookup(name, action, value)
register unsigned n;
register char *cp;
register struct syment *s;
- char buf[256];
+ char buf[1024];
if (debug)
printf("lookup(%s, %d, %x)\n", name, action, value);
@@ -144,7 +144,8 @@ lookup(name, action, value)
continue;
if (action != LOOKUP) {
if (action != INSERT || s->s_type != CONST) {
- (void)sprintf(buf, "%s redefined", name);
+ (void)snprintf(buf, sizeof buf,
+ "%s redefined", name);
yyerror(buf);
}
}
@@ -152,7 +153,7 @@ lookup(name, action, value)
}
if (action == LOOKUP) {
- (void)sprintf(buf, "%s undefined", name);
+ (void)snprintf(buf, sizeof buf, "%s undefined", name);
yyerror(buf);
return(NULL);
}