Skip to content

Commit

Permalink
MDL-38102 lib: Check for null return value from password_hash functio…
Browse files Browse the repository at this point in the history
…n call
  • Loading branch information
simoncoggins committed Feb 27, 2013
1 parent f29e62c commit d7f6936
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/moodlelib.php
Original file line number Diff line number Diff line change
Expand Up @@ -4483,7 +4483,7 @@ function hash_internal_user_password($password, $fasthash = false) {

$generatedhash = password_hash($password, PASSWORD_DEFAULT, $options);

if ($generatedhash === false) {
if ($generatedhash === false || $generatedhash === null) {
throw new moodle_exception('Failed to generate password hash.');
}

Expand Down

0 comments on commit d7f6936

Please sign in to comment.