]> git.ipfire.org Git - thirdparty/coreutils.git/commit
base64: use stricter validation on wrap column
authorPádraig Brady <P@draigBrady.com>
Sun, 16 Aug 2015 14:31:17 +0000 (15:31 +0100)
committerPádraig Brady <P@draigBrady.com>
Wed, 2 Sep 2015 23:34:12 +0000 (00:34 +0100)
commita8cc9ce3f290a83dfb656dabfab2a98e765a68a0
tree7c1a6fd442383b8aa6e494d18b0354b5719c712f
parent89c517d9e26ad232d857ba37d897adbef19b30a9
base64: use stricter validation on wrap column

* src/base64.c (main): Use the higher level xnumtoumax()
rather than xstrtoumax(), which is simpler and improves
validation of input.  Also pass the _empty_ rather than NULL
string as the suffixes parameter so that invalid trailing
characters are not allowed.  For example -w08 is now
flagged as an error, rather than being interpreted as 0.
A subsequent commit will further improve verification
of numbers with leading zeros by dropping backwards compatibility
wrt auto parsing oct and hex numbers.
* tests/misc/base64.pl: Add tests for invalid wrap values.
src/base64.c
tests/misc/base64.pl