X-Scanned-BY: MIMEDefang 2.68 on 10.5.11.27 From thozza@redhat.com Fri May 22 10:49:47 2015 MIME-Version: 1.0 X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,T_RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.0 content-type: text/plain; charset="utf-8" Message-ID: <555F09C4.4020601@redhat.com> Received: from mx.pao1.isc.org (mx.pao1.isc.org [IPv6:2001:4f8:0:2::2b]) by bugs.isc.org (Postfix) with ESMTP id 0D68B71B68D for ; Fri, 22 May 2015 10:49:47 +0000 (UTC) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx1.redhat.com", Issuer "DigiCert SHA2 Extended Validation Server CA" (not verified)) by mx.pao1.isc.org (Postfix) with ESMTPS id DA7B1349315 for ; Fri, 22 May 2015 10:49:44 +0000 (UTC) Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t4MAngZR008946 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 22 May 2015 06:49:43 -0400 Received: from [10.40.200.32] (ovpn-200-32.brq.redhat.com [10.40.200.32]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t4MAnfQX021897 for ; Fri, 22 May 2015 06:49:42 -0400 Delivered-To: bind9-bugs@bugs.isc.org User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 Subject: DEADCODE in lib/dns/rrl.c:1168 Return-Path: X-Original-To: bind9-bugs@bugs.isc.org Date: Fri, 22 May 2015 12:49:40 +0200 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mx.pao1.isc.org To: bind9-bugs@isc.org Content-Transfer-Encoding: 7bit From: "Tomas Hozza" X-RT-Original-Encoding: utf-8 X-RT-Interface: Email Content-Length: 1677 Hi. Coverity found a deadcode in lib/dns/rrl.c 1. bind-9.9.4/lib/dns/rrl.c:1162: cond_at_least: Condition "rrl_all_result != DNS_RRL_RESULT_OK", taking true branch. Now the value of "rrl_all_result" is at least 1. 2. bind-9.9.4/lib/dns/rrl.c:1166: assignment: Assigning: "rrl_result" = "rrl_all_result". 3. bind-9.9.4/lib/dns/rrl.c:1167: at_least: At condition "rrl_result == DNS_RRL_RESULT_OK", the value of "rrl_result" must be at least 1. 4. bind-9.9.4/lib/dns/rrl.c:1162: cond_cannot_single: Condition "rrl_all_result != DNS_RRL_RESULT_OK", taking true branch. Now the value of "rrl_all_result" cannot be equal to 0. 5. bind-9.9.4/lib/dns/rrl.c:1167: cannot_single: At condition "rrl_result == DNS_RRL_RESULT_OK", the value of "rrl_result" cannot be equal to 0. 6. bind-9.9.4/lib/dns/rrl.c:1167: dead_error_condition: The condition "rrl_result == DNS_RRL_RESULT_OK" cannot be true. 7. bind-9.9.4/lib/dns/rrl.c:1168: dead_error_line: Execution cannot reach this statement: "level = 4;". # 1166| rrl_result = rrl_all_result; # 1167| if (rrl_result == DNS_RRL_RESULT_OK) # 1168|-> level = DNS_RRL_LOG_DEBUG2; # 1169| else # 1170| level = DNS_RRL_LOG_DEBUG1; https://source.isc.org/cgi-bin/gitweb.cgi?p=bind9.git;a=blob;f=lib/dns/rrl.c;h=766d007514c01f85e5c43c0c40610783aeba1b41;hb=HEAD#l1163 There is a check on line 1163, assignment on line 1167, therefore the condition "if (rrl_result == DNS_RRL_RESULT_OK)" on line 1168 can never be TRUE. I'm not sure what was the intention here. Regards, -- Tomas Hozza Software Engineer - EMEA ENG Developer Experience PGP: 1D9F3C2D Red Hat Inc. http://cz.redhat.com