]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Coverity 1469730 Explicit null dereferenced: use a default sleep time if sr isn't set
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 29 Apr 2022 07:42:36 +0000 (09:42 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 29 Apr 2022 07:52:02 +0000 (09:52 +0200)
pdns/ixplore.cc

index e72ce55df2b48ff8e3fb1232949028318384c4e9..0890aa3d2507b7072b7f9a8236f1be098736f067 100644 (file)
@@ -179,8 +179,9 @@ int main(int argc, char** argv) {
       shared_ptr<SOARecordContent> sr;
       uint32_t serial = getSerialFromMaster(master, zone, sr, tt);
       if(ourSerial == serial) {
-        cout<<"still up to date, their serial is "<<serial<<", sleeping "<<sr->d_st.refresh<<" seconds"<<endl;
-        sleep(sr->d_st.refresh);
+        time_t sleepTime = sr ? sr->d_st.refresh : 60;
+        cout<<"still up to date, their serial is "<<serial<<", sleeping "<<sleepTime<<" seconds"<<endl;
+        sleep(sleepTime);
         continue;
       }