freebsd-src/usr.bin/comm
Cosimo Cecchi 7dd39ef4e0 comm: close a race condition when comm is fed from stdin
If one of the files has ended, we won't show the column, but we still
need to drain the file pointer to avoid potentially hitting a pipe
failure.

This commit moves the NULL offset checks inside show() so that getline()
and ferror() are still called on fp.

Reviewed by:	allanjude
Sponsored by:	Apple Inc.
Differential Revision:	https://reviews.freebsd.org/D45440
2024-06-06 17:04:38 +00:00
..
tests Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
comm.1 usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
comm.c comm: close a race condition when comm is fed from stdin 2024-06-06 17:04:38 +00:00
Makefile usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00