Skip to content

Commit

Permalink
Resolved Issue 14
Browse files Browse the repository at this point in the history
Very small random numbers,  so small they are represented with an
exponent, should not cause errors anymore.
  • Loading branch information
Bart Busscots committed Dec 18, 2015
1 parent 2e3435d commit aac07ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Crypt/HSXKPasswd.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1996,8 +1996,8 @@ sub _increment_random_cache{
_error('random function did not return any random numbers');
}
foreach my $num (@random_numbers){
unless($num =~ m/^1|(0([.]\d+)?)$/sx){
_error("random function returned and invalid value ($num)");
unless($num =~ m/^1|(0([.]\d+(e-\d+)?)?)$/sx){
_error("random function returned an invalid value ($num)");
}
}

Expand Down

0 comments on commit aac07ee

Please sign in to comment.