diff options
author | 1996-07-08 20:49:11 +0000 | |
---|---|---|
committer | 1996-07-08 20:49:11 +0000 | |
commit | d58fa81203eec391123d0546a127f4cc39b370e0 (patch) | |
tree | 6db90a2367fa773c6386c07d46cb55eb228c4923 | |
parent | Add support for allowing disabled devices in a config file. e.g. (diff) | |
download | wireguard-openbsd-d58fa81203eec391123d0546a127f4cc39b370e0.tar.xz wireguard-openbsd-d58fa81203eec391123d0546a127f4cc39b370e0.zip |
8lgm#26, buffer overflow
-rw-r--r-- | usr.bin/oldrdist/lookup.c | 11 |
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); } |