add INSISTs to silence tainted data false positive in Coverity

(cherry picked from commit 8a2ff13c3d)
This commit is contained in:
Mark Andrews
2014-06-12 10:42:39 +10:00
parent 82f6f5768a
commit 8a57b1e9d6

View 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;