BIND 10 master, updated. ddd815eb743887a54500fdd839e2de17571b1bf1 [master] fix clang static analyzer issue

BIND 10 source code commits bind10-changes at lists.isc.org
Tue Dec 18 23:33:34 UTC 2012


The branch, master has been updated
       via  ddd815eb743887a54500fdd839e2de17571b1bf1 (commit)
      from  214e0409215d2dc329fb4b54e3f97d2f262ad375 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ddd815eb743887a54500fdd839e2de17571b1bf1
Author: JINMEI Tatuya <jinmei at isc.org>
Date:   Tue Dec 18 17:32:11 2012 -0600

    [master] fix clang static analyzer issue
    
    Value stored to 'opt_len' during its initialization is never read
    
    discussed via jabber
    
    also use const

-----------------------------------------------------------------------

Summary of changes:
 tests/tools/perfdhcp/pkt_transform.cc |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

-----------------------------------------------------------------------
diff --git a/tests/tools/perfdhcp/pkt_transform.cc b/tests/tools/perfdhcp/pkt_transform.cc
index b1c64e2..15f15f1 100644
--- a/tests/tools/perfdhcp/pkt_transform.cc
+++ b/tests/tools/perfdhcp/pkt_transform.cc
@@ -196,12 +196,10 @@ PktTransform::unpackOptions(const OptionBuffer& in_buffer,
 
         // Get option length which is supposed to be after option type.
         offset += offset_step;
-        uint16_t opt_len = in_buffer[offset] * 256 + in_buffer[offset + 1];
-        if (option->getUniverse() == Option::V6) {
-            opt_len = in_buffer[offset] * 256 + in_buffer[offset + 1];
-        } else {
-            opt_len = in_buffer[offset];
-        }
+        const uint16_t opt_len =
+            (option->getUniverse() == Option::V6) ?
+            in_buffer[offset] * 256 + in_buffer[offset + 1] :
+            in_buffer[offset];
 
         // Check if packet is not truncated.
         if (offset + option->getHeaderLen() + opt_len > in_buffer.size()) {



More information about the bind10-changes mailing list