Skip to content

Commit da9c0cc

Browse files
committed
cov482743: no taint from local trust file lookup
1 parent e4f4aa2 commit da9c0cc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/tls/tls-jit-trust.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,8 +693,7 @@ lws_tls_jit_trust_blob_queury_skid(const void *_blob, size_t blen,
693693
*prpder = pder;
694694
siz = lws_ser_ru16be((uint8_t *)pderlen);
695695

696-
if ((const uint16_t *)(pder + siz) >=
697-
(const uint16_t *)(blob + blen))
696+
if (siz >= blen - lws_ptr_diff_size_t(pder, blob))
698697
break;
699698

700699
*prder_len = siz;

minimal-examples-lowlevel/http-client/minimal-http-client-jit-trust/minimal-http-client.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ jit_trust_query(struct lws_context *cx, const uint8_t *skid,
396396

397397
/* Once we have a result, pass it to the completion helper */
398398

399+
/* coverity[tainted_data] */
399400
return lws_tls_jit_trust_got_cert_cb(cx, got_opaque, skid, skid_len,
400401
der, der_len);
401402
}

0 commit comments

Comments
 (0)