Fixed potential overflow bug in password hash code