From 6a479db6bbb3f109b12190ea5a23ddc01a1c601e Mon Sep 17 00:00:00 2001 From: itojun Date: Fri, 18 Oct 2002 14:12:14 +0000 Subject: avoid buffer overrun. fix from openbsd. reported by Niels Heinen --- trek/getpar.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'trek') diff --git a/trek/getpar.c b/trek/getpar.c index 9a986268..d5f679aa 100644 --- a/trek/getpar.c +++ b/trek/getpar.c @@ -1,4 +1,4 @@ -/* $NetBSD: getpar.c,v 1.9 2002/02/26 02:37:28 wiz Exp $ */ +/* $NetBSD: getpar.c,v 1.10 2002/10/18 14:12:14 itojun Exp $ */ /* * Copyright (c) 1980, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)getpar.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: getpar.c,v 1.9 2002/02/26 02:37:28 wiz Exp $"); +__RCSID("$NetBSD: getpar.c,v 1.10 2002/10/18 14:12:14 itojun Exp $"); #endif #endif /* not lint */ @@ -145,7 +145,7 @@ const struct cvntab *getcodpar(s, tab) if (f) cgetc(0); /* throw out the newline */ scanf("%*[ \t;]"); - if ((c = scanf("%[^ \t;\n]", input)) < 0) + if ((c = scanf("%99[^ \t;\n]", input)) < 0) exit(1); if (c == 0) continue; -- cgit v1.2.3-56-ge451