aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-08-07 11:08:09 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-08-07 11:08:09 +0100
commit6ac122670a3dc4102e4993db2d668169183a7f32 (patch)
tree352db3c4dcb0dfabda39990c25634f2aa2c974a4
parent8faea84e51a980e4f8a5ec351cb5e3b050feac2e (diff)
downloadrspamd-6ac122670a3dc4102e4993db2d668169183a7f32.tar.gz
rspamd-6ac122670a3dc4102e4993db2d668169183a7f32.zip
[Fix] Allow to add result-less fake DNS records
-rw-r--r--contrib/librdns/resolver.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/contrib/librdns/resolver.c b/contrib/librdns/resolver.c
index 2ce85b2c5..3abb17304 100644
--- a/contrib/librdns/resolver.c
+++ b/contrib/librdns/resolver.c
@@ -982,7 +982,10 @@ void rdns_resolver_set_fake_reply (struct rdns_resolver *resolver,
if (fake_rep) {
/* Append reply to the existing list */
fake_rep->rcode = rcode;
- DL_APPEND (fake_rep->result, reply);
+
+ if (reply) {
+ DL_APPEND (fake_rep->result, reply);
+ }
}
else {
fake_rep = calloc (1, sizeof (*fake_rep) + len);
@@ -992,7 +995,11 @@ void rdns_resolver_set_fake_reply (struct rdns_resolver *resolver,
}
memcpy (&fake_rep->key, srch, sizeof (*srch) + len);
- DL_APPEND (fake_rep->result, reply);
+
+ if (reply) {
+ DL_APPEND (fake_rep->result, reply);
+ }
+
HASH_ADD (hh, resolver->fake_elts, key, sizeof (*srch) + len, fake_rep);
}
} \ No newline at end of file