From: Otto Moerbeek Date: Mon, 5 Oct 2020 10:32:00 +0000 (+0200) Subject: NULL check for return value of mutable_response() as noted by CodeQL X-Git-Tag: auth-4.4.0-alpha2~48^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dba033ad41f376b61f96a11d20b8012a6d04ed83;p=thirdparty%2Fpdns.git NULL check for return value of mutable_response() as noted by CodeQL --- diff --git a/pdns/rec-protobuf.cc b/pdns/rec-protobuf.cc index af22526170..e5a7f4e8b4 100644 --- a/pdns/rec-protobuf.cc +++ b/pdns/rec-protobuf.cc @@ -14,6 +14,9 @@ void RecProtoBufMessage::clearUDR() { #ifdef HAVE_PROTOBUF auto response = d_message.mutable_response(); + if (!response) { + return; + } const int count = response->rrs_size(); for (int idx = 0; idx < count; idx++) { auto rr = response->mutable_rrs(idx);