2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 14:07:59 +00:00

Silence tainted scalar in client.c

Coverity detected that 'optlen' was not being checked in 'process_opt'.
This is actually already done when the OPT record was initially
parsed.  Add an INSIST to silence Coverity as is done in message.c.

(cherry picked from commit 72cd6e8591)
This commit is contained in:
Mark Andrews
2025-05-29 09:42:08 +10:00
parent bdcd698edf
commit 2ecac031ba

View File

@@ -1561,6 +1561,9 @@ process_opt(ns_client_t *client, dns_rdataset_t *opt) {
while (isc_buffer_remaininglength(&optbuf) >= 4) { while (isc_buffer_remaininglength(&optbuf) >= 4) {
optcode = isc_buffer_getuint16(&optbuf); optcode = isc_buffer_getuint16(&optbuf);
optlen = isc_buffer_getuint16(&optbuf); optlen = isc_buffer_getuint16(&optbuf);
INSIST(isc_buffer_remaininglength(&optbuf) >= optlen);
/* /*
* When returning BADVERSION, only process * When returning BADVERSION, only process
* DNS_OPT_NSID or DNS_OPT_COOKIE options. * DNS_OPT_NSID or DNS_OPT_COOKIE options.