commit 620093c: [Minor] One more safety check

Vsevolod Stakhov vsevolod at highsecure.ru
Mon Jul 26 13:21:04 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-07-26 14:15:37 +0100
URL: https://github.com/rspamd/rspamd/commit/620093c2a3d306bfe4f67eede2e947025f815f5c (HEAD -> master)

[Minor] One more safety check

---
 contrib/librdns/resolver.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/contrib/librdns/resolver.c b/contrib/librdns/resolver.c
index 6036c74a8..6e3792f7e 100644
--- a/contrib/librdns/resolver.c
+++ b/contrib/librdns/resolver.c
@@ -150,7 +150,13 @@ rdns_make_reply (struct rdns_request *req, enum dns_rcode rcode)
 		rep->code = rcode;
 		req->reply = rep;
 		rep->authenticated = false;
-		rep->requested_name = req->requested_names[0].name;
+
+		if (req) {
+			rep->requested_name = req->requested_names[0].name;
+		}
+		else {
+			rep->requested_name = NULL;
+		}
 	}
 
 	return rep;


More information about the Commits mailing list