Skip to content

Commit

Permalink
Fix crash, log and accept message when reported server address is NUL…
Browse files Browse the repository at this point in the history
…L ( unknown )

fix segfault when server address is unknown
  • Loading branch information
jcbf authored Nov 3, 2016
2 parents df2f153 + 8ff33fe commit db7c047
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions smf-spf.c
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,13 @@ static sfsistat smf_connect(SMFICTX *ctx, char *name, _SOCK_ADDR *sa) {
return SMFIS_ACCEPT;
}
}

if (sa == NULL)
{
syslog(LOG_NOTICE, "unknown sender IP address, skipping SPF check");
return SMFIS_ACCEPT;
}

strscpy(host, "undefined", sizeof(host) - 1);
switch (sa->sa_family) {
case AF_INET: {
Expand Down

0 comments on commit db7c047

Please sign in to comment.