summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2018-01-28 17:39:38 +0000
committerJeremy Harris <jgh146exb@wizmail.org>2018-01-28 19:44:25 +0000
commitd011368ae0e05db3dd79c111020686f3a1364ab0 (patch)
tree1d4e58dce5be22e829ebe9e2bcc4fc084b8f238b /src
parent48dad213d10c1280139f70c1364cc68344bb2bb1 (diff)
Debugging: fix potential null-derefs in DSN debug_printfs
Diffstat (limited to 'src')
-rw-r--r--src/src/deliver.c9
-rw-r--r--src/src/dkim.c5
2 files changed, 7 insertions, 7 deletions
diff --git a/src/src/deliver.c b/src/src/deliver.c
index 05fd3ce6d..b5469908f 100644
--- a/src/src/deliver.c
+++ b/src/src/deliver.c
@@ -6150,7 +6150,7 @@ if (process_recipients != RECIP_IGNORE)
new->dsn_flags = r->dsn_flags & rf_dsnflags;
new->dsn_orcpt = r->orcpt;
DEBUG(D_deliver) debug_printf("DSN: set orcpt: %s flags: %d\n",
- new->dsn_orcpt, new->dsn_flags);
+ new->dsn_orcpt ? new->dsn_orcpt : US"", new->dsn_flags);
switch (process_recipients)
{
@@ -7219,11 +7219,12 @@ for (addr_dsntmp = addr_succeed; addr_dsntmp; addr_dsntmp = addr_dsntmp->next)
"DSN: envid: %s ret: %d\n"
"DSN: Final recipient: %s\n"
"DSN: Remote SMTP server supports DSN: %d\n",
- addr_dsntmp->router->name,
+ addr_dsntmp->router ? addr_dsntmp->router->name : US"(unknown)",
addr_dsntmp->address,
sender_address,
- addr_dsntmp->dsn_orcpt, addr_dsntmp->dsn_flags,
- dsn_envid, dsn_ret,
+ addr_dsntmp->dsn_orcpt ? addr_dsntmp->dsn_orcpt : US"NULL",
+ addr_dsntmp->dsn_flags,
+ dsn_envid ? dsn_envid : US"NULL", dsn_ret,
addr_dsntmp->address,
addr_dsntmp->dsn_aware
);
diff --git a/src/src/dkim.c b/src/src/dkim.c
index 867d45647..eefb40d82 100644
--- a/src/src/dkim.c
+++ b/src/src/dkim.c
@@ -58,7 +58,6 @@ for (rr = dns_next_rr(&dnsa, &dnss, RESET_ANSWERS);
if (rr->type == T_TXT)
{
int rr_offset = 0;
- int answer_offset = 0;
/* Copy record content to the answer buffer */
@@ -74,7 +73,7 @@ for (rr = dns_next_rr(&dnsa, &dnss, RESET_ANSWERS);
}
/* check if this looks like a DKIM record */
- if (strncmp(g->s, "v=", 2) != 0 || strncasecmp(g->s, "v=dkim", 6) == 0)
+ if (Ustrncmp(g->s, "v=", 2) != 0 || strncasecmp(CS g->s, "v=dkim", 6) == 0)
{
store_reset(g->s + g->ptr + 1);
return string_from_gstring(g);
@@ -728,7 +727,7 @@ if (!ctx.sig)
goto CLEANUP;
}
-if (prefix && (pdkim_feed(&ctx, prefix, Ustrlen(prefix))) != PDKIM_OK)
+if (prefix && (pdkim_rc = pdkim_feed(&ctx, prefix, Ustrlen(prefix))) != PDKIM_OK)
goto pk_bad;
if (lseek(fd, off, SEEK_SET) < 0)