]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
add INSISTs to silence tainted data false positive in Coverity
authorMark Andrews <marka@isc.org>
Thu, 12 Jun 2014 00:42:39 +0000 (10:42 +1000)
committerMark Andrews <marka@isc.org>
Thu, 12 Jun 2014 00:46:37 +0000 (10:46 +1000)
(cherry picked from commit 8a2ff13c3dbf43c3a3f0ff8f24d9559ec2d72089)

lib/dns/rdata/generic/tkey_249.c

index 3afee1308245b7a7e750b4245bc2e1b9aabe1761..07dae1b8b29d6c8ce33c62dc455c032f42f40afb 100644 (file)
@@ -459,6 +459,7 @@ tostruct_tkey(ARGS_TOSTRUCT) {
        /*
         * Key.
         */
+       INSIST(tkey->keylen + 2 <= sr.length);
        tkey->key = mem_maybedup(mctx, sr.base, tkey->keylen);
        if (tkey->key == NULL)
                goto cleanup;
@@ -473,6 +474,7 @@ tostruct_tkey(ARGS_TOSTRUCT) {
        /*
         * Other.
         */
+       INSIST(tkey->otherlen <= sr.length);
        tkey->other = mem_maybedup(mctx, sr.base, tkey->otherlen);
        if (tkey->other == NULL)
                goto cleanup;