]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix a condition in isc_dnsstream_assembler_incoming()
authorAram Sargsyan <aram@isc.org>
Tue, 22 Aug 2023 12:18:09 +0000 (12:18 +0000)
committerAram Sargsyan <aram@isc.org>
Thu, 24 Aug 2023 11:59:57 +0000 (11:59 +0000)
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.

lib/isc/include/isc/dnsstream.h

index 88e361331a7a9161da096f7bc708ee786a99fee1..472cf22dd341c44ad18ba7b816d91be23ebda4f4 100644 (file)
@@ -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);