From: Andreas Schneider Date: Wed, 7 Jan 2015 16:12:54 +0000 (+0100) Subject: s3-libads: Fix a possible segfault in kerberos_fetch_pac(). X-Git-Tag: samba-4.1.18~106 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5bbf2df3fe60ed124a05a515d7128fe5e750f29b;p=thirdparty%2Fsamba.git s3-libads: Fix a possible segfault in kerberos_fetch_pac(). BUG: https://bugzilla.samba.org/show_bug.cgi?id=11037 Signed-off-by: Andreas Schneider Reviewed-by: Jeremy Allison (cherry picked from commit a13e29cc4345d85ab6fe4482119386b87e4e8673) --- diff --git a/source3/libads/authdata.c b/source3/libads/authdata.c index 2c667a66bcd..b4aee72ee5b 100644 --- a/source3/libads/authdata.c +++ b/source3/libads/authdata.c @@ -59,17 +59,17 @@ static NTSTATUS kerberos_fetch_pac(struct auth4_context *auth_ctx, return NT_STATUS_NO_MEMORY; } - if (pac_blob) { + if (pac_blob != NULL) { status = kerberos_pac_logon_info(tmp_ctx, *pac_blob, NULL, NULL, NULL, NULL, 0, &logon_info); if (!NT_STATUS_IS_OK(status)) { goto done; } - } - talloc_set_name_const(logon_info, "struct PAC_LOGON_INFO"); + talloc_set_name_const(logon_info, "struct PAC_LOGON_INFO"); - auth_ctx->private_data = talloc_steal(auth_ctx, logon_info); + auth_ctx->private_data = talloc_steal(auth_ctx, logon_info); + } *session_info = talloc_zero(mem_ctx, struct auth_session_info); if (!*session_info) { status = NT_STATUS_NO_MEMORY;