]> git.ipfire.org Git - thirdparty/coreutils.git/commit
pr: fix parsing of empty arguments
authorPádraig Brady <P@draigBrady.com>
Sat, 6 May 2023 10:22:22 +0000 (11:22 +0100)
committerPádraig Brady <P@draigBrady.com>
Sat, 6 May 2023 10:26:04 +0000 (11:26 +0100)
commitfae65623a92a3f150fd35cfef58dcb3d8533f94c
tree5b07d7b17c2990a93b6258602277d167a4be6eb2
parent300af7869161a3618e28cbae3daefc25c8267efe
pr: fix parsing of empty arguments

Before:
  $ pr --expand-tabs=
  pr: '-e' extra characters or invalid number in the argument:
   ‘SHELL=/bin/bash’: Value too large for defined data type

After:
  $ pr --expand-tabs=
  pr: '-e': Invalid argument: ‘’

* src/pr.c (getoptarg): Ensure we don't parse beyond the
end of an empty argument, thus outputting arbitrary stack
info in subsequent error messages.

Addresses https://bugs.debian.org/1035596
src/pr.c