Skip to content

Commit

Permalink
Fix issue trusteddomainproject#144: Do the domain name syntax check o…
Browse files Browse the repository at this point in the history
…n the domain name, not

the whole "domain" input (which is actually the entire envelope sender).
Problem reported by Gene (@gene-git).
  • Loading branch information
Murray S. Kucherawy committed Mar 30, 2021
1 parent fc5e727 commit 5a3ba1c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libopendmarc/opendmarc_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,11 +414,11 @@ opendmarc_policy_store_spf(DMARC_POLICY_T *pctx, u_char *domain, int result, int
return DMARC_PARSE_ERROR_NULL_CTX;
if (domain == NULL || strlen((char *)domain) == 0)
return DMARC_PARSE_ERROR_EMPTY;
if (!check_domain(domain))
return DMARC_PARSE_ERROR_BAD_VALUE;
dp = opendmarc_util_finddomain(domain, domain_buf, sizeof domain_buf);
if (dp == NULL)
return DMARC_PARSE_ERROR_NO_DOMAIN;
if (!check_domain(dp))
return DMARC_PARSE_ERROR_BAD_VALUE;
if (human_readable != NULL)
pctx->spf_human_outcome = strdup((char *)human_readable);
pctx->spf_domain = strdup((char *)dp);
Expand Down

0 comments on commit 5a3ba1c

Please sign in to comment.