]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix 'Dead nested assignment's from scan-build-10
authorOndřej Surý <ondrej@isc.org>
Wed, 25 Mar 2020 16:00:07 +0000 (17:00 +0100)
committerOndřej Surý <ondrej@isc.org>
Wed, 25 Mar 2020 17:27:08 +0000 (18:27 +0100)
The 3 warnings reported are:

os.c:872:7: warning: Although the value stored to 'ptr' is used in the enclosing expression, the value is never actually read from 'ptr'
        if ((ptr = strtok_r(command, " \t", &last)) == NULL) {
             ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

--

rpz.c:1117:10: warning: Although the value stored to 'zbits' is used in the enclosing expression, the value is never actually read from 'zbits'
        return (zbits &= x);
                ^        ~
1 warning generated.

--

openssleddsa_link.c:532:10: warning: Although the value stored to 'err' is used in the enclosing expression, the value is never actually read from 'err'
        while ((err = ERR_get_error()) != 0) {
                ^     ~~~~~~~~~~~~~~~
1 warning generated.

(cherry picked from commit 262f087bcff969b6eca2ae0a71be4323a3c1729d)
(cherry picked from commit 138dded9d92de3fc966494862e8e38ded4467fc9)

lib/dns/openssleddsa_link.c
lib/dns/rpz.c

index c8fb282c01a918f6d94c07ded736b14d158d4a74..32bd02ef2bfa2a6060b66089305c6b31895e13f1 100644 (file)
@@ -518,7 +518,6 @@ static bool
 openssleddsa_isprivate(const dst_key_t *key) {
        EVP_PKEY *pkey = key->keydata.pkey;
        int len;
-       unsigned long err;
 
        if (pkey == NULL)
                return (false);
@@ -527,8 +526,9 @@ openssleddsa_isprivate(const dst_key_t *key) {
        if (len > 0)
                return (true);
        /* can check if first error is EC_R_INVALID_PRIVATE_KEY */
-       while ((err = ERR_get_error()) != 0)
+       while (ERR_get_error() != 0) {
                /**/;
+       }
 
        return (false);
 }
index eb4eaaf378aaf6838627ad1bc0e5277cdc080fe5..bbd94c70c6e662ee99ec4aa37d9e2a9a87be0201 100644 (file)
@@ -1114,7 +1114,8 @@ trim_zbits(dns_rpz_zbits_t zbits, dns_rpz_zbits_t found) {
        x = zbits & found;
        x &= (~x + 1);
        x = (x << 1) - 1;
-       return (zbits &= x);
+       zbits &= x;
+       return (zbits);
 }
 
 /*