From marka@isc.org Fri May 22 12:22:17 2015 In-Reply-To: Your message of "Fri, 22 May 2015 10:49:48 +0000." X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.0 X-RT-Interface: API References: <555F09C4.4020601@redhat.com> content-type: text/plain; charset="utf-8" Message-ID: <20150522122208.4F1612F09EDB@rock.dv.isc.org> X-RT-Original-Encoding: utf-8 Received: from mx.ams1.isc.org (mx.ams1.isc.org [IPv6:2001:500:60::65]) by bugs.isc.org (Postfix) with ESMTP id C443171B68D for ; Fri, 22 May 2015 12:22:16 +0000 (UTC) Received: from zmx1.isc.org (zmx1.isc.org [149.20.0.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx.ams1.isc.org (Postfix) with ESMTPS id 301E11FCAD8 for ; Fri, 22 May 2015 12:22:14 +0000 (UTC) Received: from zmx1.isc.org (localhost [127.0.0.1]) by zmx1.isc.org (Postfix) with ESMTPS id 88A42160056 for ; Fri, 22 May 2015 12:22:36 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by zmx1.isc.org (Postfix) with ESMTP id 79636160068 for ; Fri, 22 May 2015 12:22:36 +0000 (UTC) Received: from zmx1.isc.org ([127.0.0.1]) by localhost (zmx1.isc.org [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id OlOVQ38r5tIT for ; Fri, 22 May 2015 12:22:36 +0000 (UTC) Received: from rock.dv.isc.org (c122-106-161-187.carlnfd1.nsw.optusnet.com.au [122.106.161.187]) by zmx1.isc.org (Postfix) with ESMTPSA id 13F32160056 for ; Fri, 22 May 2015 12:22:36 +0000 (UTC) Received: from rock.dv.isc.org (localhost [IPv6:::1]) by rock.dv.isc.org (Postfix) with ESMTP id 4F1612F09EDB for ; Fri, 22 May 2015 22:22:08 +1000 (EST) Delivered-To: bind9-bugs@bugs.isc.org Subject: Re: [ISC-Bugs #39607] DEADCODE in lib/dns/rrl.c:1168 Return-Path: X-Original-To: bind9-bugs@bugs.isc.org Date: Fri, 22 May 2015 22:22:07 +1000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mx.ams1.isc.org To: bind9-bugs@isc.org From: "Mark Andrews" RT-Message-ID: Content-Length: 2435 Already being addressed. In message , "Tomas Hozza via RT" writes: > > Fri May 22 10:49:48 2015: Request 39607 was acted upon. > Transaction: Ticket created by thozza@redhat.com > Queue: bind9 > Subject: DEADCODE in lib/dns/rrl.c:1168 > Owner: Nobody > Requestors: thozza@redhat.com > Status: new > Ticket > ----------------------------------------------------------------------- > > 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_resu > lt > != 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 thi > s > 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 > > -- Mark Andrews, ISC 1 Seymour St., Dundas Valley, NSW 2117, Australia PHONE: +61 2 9871 4742 INTERNET: marka@isc.org