]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
NULL check for return value of mutable_response() as noted by CodeQL 9586/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 5 Oct 2020 10:32:00 +0000 (12:32 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 5 Oct 2020 13:20:54 +0000 (15:20 +0200)
pdns/rec-protobuf.cc

index af22526170864152a34fa29839c983805af3e0f8..e5a7f4e8b45598c59e6ec85d3a711bebafb4a98a 100644 (file)
@@ -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);