From d7ed1b530202b97a3478dd9b1290f4eba14e8c44 Mon Sep 17 00:00:00 2001 From: Joseph Sutton Date: Tue, 3 Oct 2023 20:06:29 +1300 Subject: [PATCH] s4:kdc: Check parameters of samba_kdc_get_user_info_from_pac() Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- source4/kdc/pac-glue.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/source4/kdc/pac-glue.c b/source4/kdc/pac-glue.c index 58822678e6e..0a9eea6a384 100644 --- a/source4/kdc/pac-glue.c +++ b/source4/kdc/pac-glue.c @@ -1194,6 +1194,21 @@ static krb5_error_code samba_kdc_get_user_info_from_pac(TALLOC_CTX *mem_ctx, krb5_error_code ret = 0; NTSTATUS nt_status; + if (samdb == NULL) { + ret = EINVAL; + goto out; + } + + if (!samba_krb5_pac_is_trusted(entry)) { + ret = EINVAL; + goto out; + } + + if (info_out == NULL) { + ret = EINVAL; + goto out; + } + *info_out = NULL; if (resource_groups_out != NULL) { *resource_groups_out = NULL; -- 2.34.1