]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
silence coverity warnings
authorMark Andrews <marka@isc.org>
Wed, 2 Jul 2014 05:28:02 +0000 (15:28 +1000)
committerMark Andrews <marka@isc.org>
Wed, 2 Jul 2014 05:28:02 +0000 (15:28 +1000)
bin/dnssec/dnssec-revoke.c
lib/dns/nsec3.c
lib/dns/time.c

index 1d09d9f4bd7c1f91035c5b02e2fa30a9b91e710e..1adaed239379a5d55f502d544cb8e246a82f613b 100644 (file)
@@ -263,12 +263,10 @@ main(int argc, char **argv) {
                        dst_key_buildfilename(key, DST_TYPE_PRIVATE, dir, &buf);
                        if (strcmp(oldname, newname) == 0)
                                goto cleanup;
-                       if (access(oldname, F_OK) == 0)
-                               unlink(oldname);
+                       (void)unlink(oldname);
                        isc_buffer_clear(&buf);
                        dst_key_buildfilename(key, DST_TYPE_PUBLIC, dir, &buf);
-                       if (access(oldname, F_OK) == 0)
-                               unlink(oldname);
+                       (void)unlink(oldname);
                }
        } else {
                dst_key_format(key, keystr, sizeof(keystr));
index 62685f30d6b76e18efe97351089516eeff67104e..619cb4e346e016056745d963e44a341822c70390 100644 (file)
@@ -845,8 +845,8 @@ dns_nsec3_addnsec3(dns_db_t *db, dns_dbversion_t *version,
                dns_db_detachnode(db, &newnode);
        } while (1);
 
-       if (result == ISC_R_NOMORE)
-               result = ISC_R_SUCCESS;
+       /* result cannot be ISC_R_NOMORE here */
+       INSIST(result != ISC_R_NOMORE);
 
  failure:
        if (dbit != NULL)
index b3d2c2d084498eee106d235de5f04f9dc4fbe41c..5dce072811950c7186ab50cbb1c2b69670dbe0a6 100644 (file)
@@ -161,6 +161,14 @@ dns_time64_fromtext(const char *source, isc_int64_t *target) {
        RANGE(1, 12, month);
        RANGE(1, days[month - 1] +
                 ((month == 2 && is_leap(year)) ? 1 : 0), day);
+#ifdef __COVERITY__
+       /*
+        * Use a simplified range to silence Coverity warning (in
+        * arithmetic with day below).
+        */
+       RANGE(1, 31, day);
+#endif /* __COVERITY__ */
+
        RANGE(0, 23, hour);
        RANGE(0, 59, minute);
        RANGE(0, 60, second);           /* 60 == leap second. */