mirror of
https://github.com/openbsd/src.git
synced 2024-12-22 16:42:56 -08:00
terminate the buffer before calling regexec(3) when prompting for
confirmation. fixes a crash with malloc options; otto@ ok.
This commit is contained in:
parent
40dd85304c
commit
39c003f832
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: xargs.c,v 1.22 2005/09/12 09:44:59 jmc Exp $ */
|
||||
/* $OpenBSD: xargs.c,v 1.23 2005/09/26 20:32:04 fgsch Exp $ */
|
||||
/* $FreeBSD: xargs.c,v 1.51 2003/05/03 19:09:11 obrien Exp $ */
|
||||
|
||||
/*-
|
||||
@ -45,7 +45,7 @@ static const char copyright[] =
|
||||
#if 0
|
||||
static const char sccsid[] = "@(#)xargs.c 8.1 (Berkeley) 6/6/93";
|
||||
#else
|
||||
static const char rcsid[] = "$OpenBSD: xargs.c,v 1.22 2005/09/12 09:44:59 jmc Exp $";
|
||||
static const char rcsid[] = "$OpenBSD: xargs.c,v 1.23 2005/09/26 20:32:04 fgsch Exp $";
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -609,6 +609,7 @@ prompt(void)
|
||||
(void)fclose(ttyfp);
|
||||
return (0);
|
||||
}
|
||||
response[rsize - 1] = '\0';
|
||||
match = regexec(&cre, response, 0, NULL, 0);
|
||||
(void)fclose(ttyfp);
|
||||
regfree(&cre);
|
||||
|
Loading…
Reference in New Issue
Block a user