Permalink
Browse files

MDL-38102 lib: Check for null return value from password_hash functio…

…n call
  • Loading branch information...
1 parent f29e62c commit d7f69362b9b54535d81c3b094d1699b6e0b40483 @simoncoggins simoncoggins committed Feb 27, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/moodlelib.php
View
@@ -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.');
}

0 comments on commit d7f6936

Please sign in to comment.