]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
CodeQL: two instances of expressions being always true 9935/head
authorOtto <otto.moerbeek@open-xchange.com>
Mon, 11 Jan 2021 14:01:18 +0000 (15:01 +0100)
committerOtto <otto.moerbeek@open-xchange.com>
Mon, 11 Jan 2021 14:01:18 +0000 (15:01 +0100)
pdns/dnsdist-lua-actions.cc
pdns/ssqlite3.cc

index 9102feac4db4585cf13100a37a2820ea858718da..45fa66633713a3477766cd5ce6ec2618be284f08 100644 (file)
@@ -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)
index 8fc9466a436fdcc1ce2e10a89885efc95fe2d6e4..8602f162ff513bb02bf760104c63bd70f08b7888 100644 (file)
@@ -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: "<<ret<<endl;