From 011985f17ca59c79ff083b0c4422ad2b8c7d05fa Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Tue, 6 Sep 2011 14:23:53 +0200 Subject: Add tests for passing POSIX::Termios->getcc() out of range subscripts. --- ext/POSIX/t/termios.t | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ext/POSIX/t') diff --git a/ext/POSIX/t/termios.t b/ext/POSIX/t/termios.t index e68fb5ad35..636efe1670 100644 --- a/ext/POSIX/t/termios.t +++ b/ext/POSIX/t/termios.t @@ -54,6 +54,11 @@ if (defined $termios) { is($@, '', "calling getcc($i)"); like($r, qr/\A-?[0-9]+\z/, 'returns an integer'); } + for my $i (NCCS, ~0) { + my $r = eval { $termios->getcc($i) }; + like($@, qr/\ABad getcc subscript/, "calling getcc($i)"); + is($r, undef, 'returns undef') + } for my $method (qw(getcflag getiflag getispeed getlflag getoflag getospeed)) { my $r = eval { $termios->$method() }; -- cgit v1.2.1