From: Otto Date: Mon, 11 Jan 2021 14:01:18 +0000 (+0100) Subject: CodeQL: two instances of expressions being always true X-Git-Tag: rec-4.5.0-alpha1~18^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F9935%2Fhead;p=thirdparty%2Fpdns.git CodeQL: two instances of expressions being always true --- diff --git a/pdns/dnsdist-lua-actions.cc b/pdns/dnsdist-lua-actions.cc index 9102feac4d..45fa666337 100644 --- a/pdns/dnsdist-lua-actions.cc +++ b/pdns/dnsdist-lua-actions.cc @@ -237,7 +237,7 @@ void TeeAction::worker() res=recv(d_fd, packet, sizeof(packet), 0); if(res <= (int)sizeof(struct dnsheader)) d_recverrors++; - else if(res > 0) + else d_responses++; if(dh->rcode == RCode::NoError) diff --git a/pdns/ssqlite3.cc b/pdns/ssqlite3.cc index 8fc9466a43..8602f162ff 100644 --- a/pdns/ssqlite3.cc +++ b/pdns/ssqlite3.cc @@ -216,7 +216,7 @@ void SSQLite3::setLog(bool state) SSQLite3::~SSQLite3() { int ret; - for(int n = 0; n < 2 ; ++n) { + for(int n = 0; ; ++n) { if((ret =sqlite3_close( m_pDB )) != SQLITE_OK) { if(n || ret != SQLITE_BUSY) { // if we have SQLITE_BUSY, and a working m_Pstmt, try finalize cerr<<"Unable to close down sqlite connection: "<