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 <github@ideco.ru>
This commit is contained in:
Shchelkunov Artem 2021-08-20 17:52:14 +05:00
parent 54b7554b5a
commit 5730e7bb59
No known key found for this signature in database
GPG key ID: E40FE4DB66ACF9FF

View file

@ -913,8 +913,9 @@ dns64_adjust_ptr(struct module_qstate* qstate, struct module_qstate* super)
sizeof(struct dns_msg)))) sizeof(struct dns_msg))))
return; return;
super->return_msg->qinfo = super->qinfo; super->return_msg->qinfo = super->qinfo;
super->return_msg->rep = reply_info_copy(qstate->return_msg->rep, NULL, if (!(super->return_msg->rep = reply_info_copy(qstate->return_msg->rep,
super->region); NULL, super->region)))
return;
/* /*
* Adjust the domain name of the answer RR set so that it matches the * Adjust the domain name of the answer RR set so that it matches the