From: Joshua Rogers Date: Sat, 6 Sep 2025 08:28:12 +0000 (+0000) Subject: ext_ad_group_acl: Fix domain lookup error handling (#2180) X-Git-Tag: SQUID_7_2~36 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9330f99fd1cff48d29b448703a4ead4ddb02b386;p=thirdparty%2Fsquid.git ext_ad_group_acl: Fix domain lookup error handling (#2180) On errors, the helper was reporting DsRoleGetPrimaryDomainInformation() error info using the wrong/bogus error code and probably freeing an uninitialized pointer. --- diff --git a/src/acl/external/AD_group/ext_ad_group_acl.cc b/src/acl/external/AD_group/ext_ad_group_acl.cc index 902ed7fa93..fe5e59b1dd 100644 --- a/src/acl/external/AD_group/ext_ad_group_acl.cc +++ b/src/acl/external/AD_group/ext_ad_group_acl.cc @@ -318,10 +318,10 @@ static char * GetDomainName(void) { static char *DomainName = nullptr; - PDSROLE_PRIMARY_DOMAIN_INFO_BASIC pDSRoleInfo; + PDSROLE_PRIMARY_DOMAIN_INFO_BASIC pDSRoleInfo = nullptr; DWORD netret; - if ((netret = DsRoleGetPrimaryDomainInformation(nullptr, DsRolePrimaryDomainInfoBasic, (PBYTE *) & pDSRoleInfo) == ERROR_SUCCESS)) { + if ((netret = DsRoleGetPrimaryDomainInformation(nullptr, DsRolePrimaryDomainInfoBasic, (PBYTE *) & pDSRoleInfo)) == ERROR_SUCCESS) { /* * Check the machine role. */