From: Mark Andrews Date: Fri, 2 Aug 2024 08:13:49 +0000 (+0000) Subject: [9.18] fix: dev: Remove unnecessary operations X-Git-Tag: v9.18.29~18 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=2374a1a2bd56eaf4cf27a9c1bdfa3430222872c0;p=thirdparty%2Fbind9.git [9.18] fix: dev: Remove unnecessary operations Decrementing optlen immediately before calling continue is unneccesary and inconsistent with the rest of dns_message_pseudosectiontoyaml and dns_message_pseudosectiontotext. Coverity was also reporting an impossible false positive overflow of optlen (CID 499061). 4176 } else if (optcode == DNS_OPT_CLIENT_TAG) { 4177 uint16_t id; 4178 ADD_STRING(target, "; CLIENT-TAG:"); 4179 if (optlen == 2U) { 4180 id = isc_buffer_getuint16(&optbuf); 4181 snprintf(buf, sizeof(buf), " %u ", id); 4182 ADD_STRING(target, buf); CID 499061: (#1 of 1): Overflowed constant (INTEGER_OVERFLOW) overflow_const: Expression optlen, which is equal to 65534, underflows the type that receives it, an unsigned integer 16 bits wide. 4183 optlen -= 2; 4184 POST(optlen); 4185 continue; 4186 } 4187 } else if (optcode == DNS_OPT_SERVER_TAG) { Backport of MR !9130 Merge branch 'backport-marka-remove-unnecessary-operations-9.18' into 'bind-9.18' See merge request isc-projects/bind9!9224 --- 2374a1a2bd56eaf4cf27a9c1bdfa3430222872c0