]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
ext_ad_group_acl: Fix domain lookup error handling (#2180)
authorJoshua Rogers <MegaManSec@users.noreply.github.com>
Sat, 6 Sep 2025 08:28:12 +0000 (08:28 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sat, 6 Sep 2025 11:11:34 +0000 (11:11 +0000)
On errors, the helper was reporting DsRoleGetPrimaryDomainInformation()
error info using the wrong/bogus error code and probably freeing an
uninitialized pointer.

src/acl/external/AD_group/ext_ad_group_acl.cc

index 610059a23b0ee0e5a6c77960aa3a400e01b32dfd..8b0d3ac89dbf78fa77a7dc978b878ba80118b406 100644 (file)
@@ -320,10 +320,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.
          */