CC: | 571270 [...] rt.noris.net |
Subject: | invalid data causes infinite loop |
Games::Sudoku seems to run in an (at least practically) infinite loop when fed with invalid data, e.g.:
use Games::Sudoku::Board;
my @board = qw(
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 3 3
0 2 0 0 3 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
);
my $game = Games::Sudoku::Board->new( foo => 1 );
$game->init(\@board);
$game->solve;
I'm not sure if you'll consider this a bug, but at least it prevents me from using the module on a public website.
Regards,
fany
use Games::Sudoku::Board;
my @board = qw(
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 3 3
0 2 0 0 3 0 0 0 0
0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0
);
my $game = Games::Sudoku::Board->new( foo => 1 );
$game->init(\@board);
$game->solve;
I'm not sure if you'll consider this a bug, but at least it prevents me from using the module on a public website.
Regards,
fany