Skip to content

opendkim: fix always-false NULL check on mctx_domain array (issue #88)#343

Merged
thegushi merged 1 commit into
trusteddomainproject:developfrom
thegushi:issue-88-mctx-domain-null-check
May 25, 2026
Merged

opendkim: fix always-false NULL check on mctx_domain array (issue #88)#343
thegushi merged 1 commit into
trusteddomainproject:developfrom
thegushi:issue-88-mctx-domain-null-check

Conversation

@thegushi
Copy link
Copy Markdown
Collaborator

Summary

  • mctx_domain is declared as unsigned char mctx_domain[DKIM_MAXHOSTNAMELEN + 1] - a fixed-size array, not a pointer
  • The comparison dfc->mctx_domain == NULL is always false, meaning the error-log-and-return path at that site was dead code
  • Changed to dfc->mctx_domain[0] == '\0' to correctly detect an unset message domain, consistent with the same check at line 11952

Fixes #88

…steddomainproject#88)

mctx_domain is a fixed-size array, not a pointer; comparing it to NULL
is always false.  The intent is to detect an unset message domain, so
use mctx_domain[0] == '\0' consistent with other checks in the file.

Fixes trusteddomainproject#88
@thegushi thegushi merged commit e0d7e14 into trusteddomainproject:develop May 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant