tail: fix uninitialized memory read when failing to read file
commit6f30a99fa537adb029283cf2ef03cb4419350e6c
authorPádraig Brady <P@draigBrady.com>
Sun, 27 Nov 2016 13:00:35 +0000 (27 13:00 +0000)
committerPádraig Brady <P@draigBrady.com>
Sun, 27 Nov 2016 21:10:15 +0000 (27 21:10 +0000)
treed41198f0dfa6f0001acf809ac4b1ecfcf518a37d
parent5c09e82b4f0227b957ba1a73695abe9b0a3fd78b
tail: fix uninitialized memory read when failing to read file

Reproduced under UBSAN with `tail -f <&-` giving:
  tail.c:2220:18: runtime error: load of value 190,
  which is not a valid value for type ‘_Bool'

* src/tail.c (tail_file): Ensure f->ignore is initialized
in all cases where we can't tail the specified file.
* tests/tail-2/follow-stdin.sh: Add a test case which
checks stderr has no UBSAN warnings.
Fixes http://bugs.gnu.org/25041
src/tail.c
tests/tail-2/follow-stdin.sh