[PATCH 02/12] s4-auth: Use sizeof() rather than a fixed constant in memcmp() call
Kamen Mazdrashki
kamenim at samba.org
Sun Sep 7 21:18:02 MDT 2014
Reviewed-by: Kamen Mazdrashki <kamenim at samba.org>
On Mon, Sep 8, 2014 at 1:30 AM, <abartlet at samba.org> wrote:
> From: Andrew Bartlett <abartlet at samba.org>
>
> Change-Id: I2807cf2af9e4c3282e6ff54a6dd8e90f34e9481f
> Signed-off-by: Andrew Bartlett <abartlet at samba.org>
> ---
> source4/auth/ntlm/auth_sam.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/source4/auth/ntlm/auth_sam.c b/source4/auth/ntlm/auth_sam.c
> index 6e2dd44..17f3cfc 100644
> --- a/source4/auth/ntlm/auth_sam.c
> +++ b/source4/auth/ntlm/auth_sam.c
> @@ -326,7 +326,8 @@ static NTSTATUS
> authsam_password_check_and_record(struct auth4_context *auth_con
> }
>
> /* Skip over all-zero hashes in the history */
> - if (memcmp(nt_history_pwd->hash, zero_hash.hash, 16) == 0)
> {
> + if (memcmp(nt_history_pwd->hash, zero_hash.hash,
> + sizeof(zero_hash.hash)) == 0) {
> continue;
> }
>
> --
> 2.1.0
>
>
More information about the samba-technical
mailing list