]> git.ipfire.org Git - thirdparty/coreutils.git/commit
tr: fix crash validating -c with some case char classes
authorPádraig Brady <P@draigBrady.com>
Sat, 14 Nov 2020 16:47:05 +0000 (16:47 +0000)
committerPádraig Brady <P@draigBrady.com>
Sat, 14 Nov 2020 16:51:49 +0000 (16:51 +0000)
commit2bc66c5ea7e507786a45c1b6b15fe74a338240f4
treeadee9becd39400532bcf28670647f77525c51f38
parent1833f51aaa59e581df2adf235e01977747944690
tr: fix crash validating -c with some case char classes

This crash was identified by Cyber Independent Testing Lab:
https://cyber-itl.org/2020/10/28/citl-7000-defects.html
and was introduced with commit v8.5-163-g3f48829c2

* src/tr.c (validate_case_classes): Don't apply these
extra case alignment checks in the --complement case,
which is even more restrictive as to the contents of SET2.
* tests/misc/tr-case-class.sh: Add a test case,
for a large SET1, which caused the length adjustment
in validate_case_classes to underflow and trigger the assert.
* NEWS: Mention the bug fix.
NEWS
src/tr.c
tests/misc/tr-case-class.sh