]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Cleanup couple of set-but-unused errors from Coverity
authorOndřej Surý <ondrej@sury.org>
Fri, 24 Aug 2018 19:38:39 +0000 (21:38 +0200)
committerStephen Morris <stephen@isc.org>
Mon, 27 Aug 2018 14:12:19 +0000 (10:12 -0400)
lib/dns/rdataset.c
lib/isc/pk11.c

index 4145b11a242956a5a3aaaf49dd914c7fb988071e..d6dcc91b4897aec5aa79ee0888fcbe9afafdf2d6 100644 (file)
@@ -312,8 +312,7 @@ towire_compare(const void *av, const void *bv) {
 
 static inline void
 swap_rdata(dns_rdata_t *in, unsigned int a, unsigned int b) {
-       dns_rdata_t rdata = DNS_RDATA_INIT;
-       rdata = in[a];
+       dns_rdata_t rdata = in[a];
        in[a] = in[b];
        in[b] = rdata;
 }
@@ -403,7 +402,7 @@ towiresorted(dns_rdataset_t *rdataset, const dns_name_t *owner_name,
 
        if ((shuffle || sort)) {
                uint32_t seed = 0;
-               unsigned int j;
+               unsigned int j = 0;
 
                /*
                 * First we get handles to all of the rdata.
@@ -423,15 +422,12 @@ towiresorted(dns_rdataset_t *rdataset, const dns_name_t *owner_name,
 
                if (ISC_LIKELY(want_random)) {
                        seed = isc_random32();
-                       j = 0;
                }
 
                if (ISC_UNLIKELY(want_cyclic) &&
                    (rdataset->count != DNS_RDATASET_COUNT_UNDEFINED))
                {
                        j = rdataset->count % count;
-               } else { /* Otherwise, just start from beginning */
-                       j = 0;
                }
 
                for (i = 0; i < count; i++) {
index 4624e94d4737500cb652f1d4b1867456a9b67fa5..13b4d75eb02367104d7543ba2e941213521af9ea 100644 (file)
@@ -445,10 +445,11 @@ token_login(pk11_session_t *sp) {
                                  (CK_UTF8CHAR_PTR) token->pin,
                                  (CK_ULONG) strlen(token->pin));
                if (rv != CKR_OK) {
-                       ret = ISC_R_NOPERM;
 #if PK11_NO_LOGERR
                        pk11_error_fatalcheck(__FILE__, __LINE__,
                                              "pkcs_C_Login", rv);
+#else
+                       ret = ISC_R_NOPERM;
 #endif
                } else
                        token->logged = true;
@@ -766,14 +767,13 @@ pk11_attribute_bytype(const pk11_object_t *obj, CK_ATTRIBUTE_TYPE type) {
 static char *
 percent_decode(char *x, size_t *len) {
        char *p, *c;
-       unsigned char v;
+       unsigned char v = 0;
 
        INSIST(len != NULL);
 
        for (p = c = x; p[0] != '\0'; p++, c++) {
                switch (p[0]) {
                case '%':
-                       v = 0;
                        switch (p[1]) {
                        case '0':
                        case '1':
@@ -1112,7 +1112,6 @@ pk11_dump_tokens(void) {
                if (token->operations & (1 << OP_ECDSA)) {
                        if (!first)
                                printf(",");
-                       first = false;
                        printf("EC");
                }
                printf(")\n");