summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2013-02-04 11:39:20 +0000
committerPádraig Brady <P@draigBrady.com>2013-02-04 13:55:01 +0000
commitbe7932e863de07c4c7e4fc3c1db3eb6d04ba9af5 (patch)
tree46160fbc21278846454f9264d82ca0d505099658 /tests
parentd57ebc45ba4c59cc6f8bb0e9a435ecbddc84b982 (diff)
downloadcoreutils-be7932e863de07c4c7e4fc3c1db3eb6d04ba9af5.tar.xz
cut: fix a segfault with disjoint open ended ranges
Fixes the issue introduced in unreleased commit v8.20-60-gec48bea. * src/cut.c (set_fields): Don't access the bit array if we've an open ended range that's outside any finite range. * tests/misc/cut.pl: Add tests for this case. Reported by Marcel Böhme in http://bugs.gnu.org/13627
Diffstat (limited to 'tests')
-rwxr-xr-xtests/misc/cut.pl3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/misc/cut.pl b/tests/misc/cut.pl
index 874c16900..41e9e2093 100755
--- a/tests/misc/cut.pl
+++ b/tests/misc/cut.pl
@@ -193,6 +193,9 @@ my @Tests =
['inval6', '-f', '-1,-', {IN=>''}, {OUT=>''}, {EXIT=>1}, {ERR=>$no_endpoint}],
# This would evoke a segfault from 5.3.0..8.10
['big-unbounded-b', '--output-d=:', '-b1234567890-', {IN=>''}, {OUT=>''}],
+ ['big-unbounded-b2a', '--output-d=:', '-b1,9-', {IN=>'123456789'},
+ {OUT=>"1:9\n"}],
+ ['big-unbounded-b2b', '--output-d=:', '-b1,1234567890-', {IN=>''}, {OUT=>''}],
['big-unbounded-c', '--output-d=:', '-c1234567890-', {IN=>''}, {OUT=>''}],
['big-unbounded-f', '--output-d=:', '-f1234567890-', {IN=>''}, {OUT=>''}],