mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-23 01:14:52 +01:00
In next(), ensure that 'done' is set in the case when a file cannot
be opened, to avoid trying to read standard input after already closing it, which resulted in EBADF errors.
This commit is contained in:
parent
c92781c506
commit
9a1e2d06e8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=133099
@ -346,13 +346,14 @@ next(char **argv)
|
||||
}
|
||||
for (;;) {
|
||||
if (*_argv) {
|
||||
done = 1;
|
||||
if (!(freopen(*_argv, "r", stdin))) {
|
||||
warn("%s", *_argv);
|
||||
exitval = 1;
|
||||
++_argv;
|
||||
continue;
|
||||
}
|
||||
statok = done = 1;
|
||||
statok = 1;
|
||||
} else {
|
||||
if (done++)
|
||||
return(0);
|
||||
|
Loading…
Reference in New Issue
Block a user