Skip to content

Commit

Permalink
Fix rcube_utils::random_bytes() to not throw exception for length=0
Browse files Browse the repository at this point in the history
  • Loading branch information
thomascube committed Oct 29, 2017
1 parent 392f88a commit 3762dba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion program/lib/Roundcube/rcube_utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -1167,7 +1167,7 @@ public static function random_bytes($length, $raw = false)

$random = openssl_random_pseudo_bytes($length);

if ($random === false) {
if ($random === false && $length > 0) {
throw new Exception("Failed to get random bytes");
}

Expand Down

0 comments on commit 3762dba

Please sign in to comment.