]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
[v9_9] silence ccc-analyzer
authorEvan Hunt <each@isc.org>
Fri, 3 May 2013 21:23:20 +0000 (14:23 -0700)
committerEvan Hunt <each@isc.org>
Fri, 3 May 2013 21:35:55 +0000 (14:35 -0700)
3567. [bug] Silence clang static analyzer warnings. [RT #33365]

CHANGES
bin/dnssec/dnssec-keygen.c
bin/named/server.c
lib/dns/zone.c

diff --git a/CHANGES b/CHANGES
index 06530b5a321e80adc5b9702e26fdecaf3fe6a506..8f9b953318cf7bbe2b0cb6dc3d332260c0ce36c6 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+3567.  [bug]           Silence clang static analyzer warnings. [RT #33365]
+
 3563.  [contrib]       zone2sqlite failed with some table names. [RT #33375]
 
 3561.  [bug]           dig: issue a warning if an EDNS query returns FORMERR
index 5a30ca55b7416e4a03e3e28f53f141e98e5a2431..1e61ca392e8600a7b4ef0e0c8f47f132bbfb68f1 100644 (file)
@@ -535,6 +535,7 @@ main(int argc, char **argv) {
                                        "recommended.\nIf you still wish to "
                                        "use RSA (RSAMD5) please specify "
                                        "\"-a RSAMD5\"\n");
+                       INSIST(freeit == NULL);
                        return (1);
                } else if (strcasecmp(algname, "HMAC-MD5") == 0)
                        alg = DST_ALG_HMACMD5;
index 4d9126c9166de2892eee80198f0eff0542579ef7..aef922bb73bc3387031708f8c1bb2693dd16c5dd 100644 (file)
@@ -6130,6 +6130,7 @@ zone_from_args(ns_server_t *server, char *args, const char *zonetxt,
        dns_rdataclass_t rdclass;
 
        REQUIRE(zonep != NULL && *zonep == NULL);
+       REQUIRE(zonename == NULL || *zonename == NULL);
 
        input = args;
 
@@ -6145,7 +6146,7 @@ zone_from_args(ns_server_t *server, char *args, const char *zonetxt,
                zonetxt = next_token(&input, " \t");
        if (zonetxt == NULL)
                return (ISC_R_SUCCESS);
-       if (zonename)
+       if (zonename != NULL)
                *zonename = zonetxt;
 
        /* Look for the optional class name. */
@@ -7954,8 +7955,8 @@ ns_server_del_zone(ns_server_t *server, char *args) {
                goto cleanup;
        }
 
-       if (zonename != NULL)
-               znamelen = strlen(zonename);
+       INSIST(zonename != NULL);
+       znamelen = strlen(zonename);
 
        /* Dig out configuration for this zone */
        view = dns_zone_getview(zone);
index a60ee79b94b33ea35393d3579cdc3354e225cf2f..10ba807c52f17d649562c27af698fb27beffd36c 100644 (file)
@@ -2490,6 +2490,10 @@ isspf(const dns_rdata_t *rdata) {
                data += tl;
                rdl -= tl;
        }
+
+       if (i < 6U)
+               return(ISC_FALSE);
+
        buf[i] = 0;
        if (strncmp(buf, "v=spf1", 6) == 0 && (buf[6] == 0 || buf[6] == ' '))
                return (ISC_TRUE);