From 5730e7bb594d250600d882d04ae1bc7cb10c99e8 Mon Sep 17 00:00:00 2001 From: Shchelkunov Artem Date: Fri, 20 Aug 2021 17:52:14 +0500 Subject: [PATCH] Fix: dereferencing a null pointer Found by static analyzer svace Static analyzer message: Return value of a function 'reply_info_copy' is dereferenced at dns64.c:923 without checking, but it is usually checked for this function (4/5). on-behalf-of: @ideco-team --- dns64/dns64.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dns64/dns64.c b/dns64/dns64.c index c79bc9c65..8872f10b0 100644 --- a/dns64/dns64.c +++ b/dns64/dns64.c @@ -913,8 +913,9 @@ dns64_adjust_ptr(struct module_qstate* qstate, struct module_qstate* super) sizeof(struct dns_msg)))) return; super->return_msg->qinfo = super->qinfo; - super->return_msg->rep = reply_info_copy(qstate->return_msg->rep, NULL, - super->region); + if (!(super->return_msg->rep = reply_info_copy(qstate->return_msg->rep, + NULL, super->region))) + return; /* * Adjust the domain name of the answer RR set so that it matches the -- 2.39.5