[git commit] xxd: do not try reading from closed stdin when non-existent file is given

Denys Vlasenko vda.linux at googlemail.com
Thu Jun 17 22:32:29 UTC 2021


commit: https://git.busybox.net/busybox/commit/?id=25fe2d50bd75097861db9eac8c8c9f238283ff5f
branch: https://git.busybox.net/busybox/commit/?id=refs/heads/master

Was:
	xxd: FILE: No such file or directory
	xxd: FILE: Bad file descriptor

function                                             old     new   delta
next                                                 276     278      +2

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 libbb/dump.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libbb/dump.c b/libbb/dump.c
index 8c2a370d0..9c16f1f94 100644
--- a/libbb/dump.c
+++ b/libbb/dump.c
@@ -357,6 +357,7 @@ static NOINLINE int next(priv_dumper_t *dumper)
 				if (!freopen(fname, "r", stdin)) {
 					bb_simple_perror_msg(fname);
 					dumper->exitval = 1;
+					dumper->next__done = 1;
 					continue;
 				}
 			}


More information about the busybox-cvs mailing list