]> 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)
committerAmos Jeffries <yadij@users.noreply.github.com>
Sun, 7 Sep 2025 02:29:45 +0000 (14:29 +1200)
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 902ed7fa932868ca199f5772f2e00a7a400b3147..fe5e59b1dda97af74e25f4e0ba5f2589a728165a 100644 (file)
@@ -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.
          */