From: Aram Sargsyan Date: Tue, 22 Aug 2023 12:18:09 +0000 (+0000) Subject: Fix a condition in isc_dnsstream_assembler_incoming() X-Git-Tag: v9.19.17~31^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a33dc921dced66baac8e661da66b96a70c30b55e;p=thirdparty%2Fbind9.git Fix a condition in isc_dnsstream_assembler_incoming() Before calling isc_buffer_putmem(), there is a condition to check that 'buf_size' is greater than 0. At this point 'buf_size' is guaranteed to be greater than zero, so either the condition is redundant, or 'unprocessed_size' should be checked instead, which seems more logical, because calling isc_buffer_putmem() with 'unprocessed_size' being zero is not useful, although harmless. --- diff --git a/lib/isc/include/isc/dnsstream.h b/lib/isc/include/isc/dnsstream.h index 88e361331a7..472cf22dd34 100644 --- a/lib/isc/include/isc/dnsstream.h +++ b/lib/isc/include/isc/dnsstream.h @@ -540,7 +540,7 @@ isc_dnsstream_assembler_incoming(isc_dnsstream_assembler_t *restrict dnsasm, return; } - if (buf_size > 0) { + if (unprocessed_size > 0) { isc_buffer_putmem(dnsasm->current, unprocessed_buf, unprocessed_size);