From 8a57b1e9d64e1019c2e56ee2cc15dfd6524e47e2 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 12 Jun 2014 10:42:39 +1000 Subject: [PATCH] add INSISTs to silence tainted data false positive in Coverity (cherry picked from commit 8a2ff13c3dbf43c3a3f0ff8f24d9559ec2d72089) --- lib/dns/rdata/generic/tkey_249.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/dns/rdata/generic/tkey_249.c b/lib/dns/rdata/generic/tkey_249.c index 3afee13082..07dae1b8b2 100644 --- a/lib/dns/rdata/generic/tkey_249.c +++ b/lib/dns/rdata/generic/tkey_249.c @@ -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;