]> git.ipfire.org Git - thirdparty/coreutils.git/commit
dd: fix parsing of numbers with more than two multipliers
authorPádraig Brady <P@draigBrady.com>
Sat, 10 Jun 2023 13:18:00 +0000 (14:18 +0100)
committerPádraig Brady <P@draigBrady.com>
Sun, 11 Jun 2023 22:10:34 +0000 (23:10 +0100)
commite8e81fc44b9cf5fa4c13fa8b2824278b75566398
treef857c1a112e8443b43e840ce5c8bad8ad88ce9fa
parentb841f111de3e7f21c838b2e3ad2d886c21791916
dd: fix parsing of numbers with more than two multipliers

* src/dd.c (parse_integer): Use recursion to support more than two
multipliers.  Also protect suffix[-1] access to ensure we don't
inspect before the passed string.
* tests/dd/bytes.sh: Add test cases.
* doc/coreutils.texi (dd invocation): Note the support for specifying
many multipliers in a number.
* NEWS: Mention the bug fix.
Fixes https://bugs.debian.org/1037275
NEWS
doc/coreutils.texi
src/dd.c
tests/dd/bytes.sh