]> git.ipfire.org Git - thirdparty/bind9.git/commit
Fix isc_buffer_copyregion() for auto-reallocated buffers
authorMichał Kępień <michal@isc.org>
Tue, 30 Oct 2018 12:33:25 +0000 (13:33 +0100)
committerMichał Kępień <michal@isc.org>
Tue, 30 Oct 2018 12:33:25 +0000 (13:33 +0100)
commite1f0aed03434e9f49208da8c7f617855665d6bca
tree26954e244d62e48a66e8c8426ee881abe3609649
parent15440d8027cdbc5557e6c71a389e1aa69d2b6f50
Fix isc_buffer_copyregion() for auto-reallocated buffers

While isc_buffer_copyregion() calls isc_buffer_reserve() to ensure the
target buffer will have enough available space to append the contents of
the source region to it, the variables used for subsequently checking
available space are not updated accordingly after that call.  This
prevents isc_buffer_copyregion() from working as expected for
auto-reallocated buffers: ISC_R_NOSPACE will be returned if enough space
is not already available in the target buffer before it is reallocated.
Fix by calling isc_buffer_used() and isc_buffer_availablelength()
directly instead of assigning their return values to local variables.
lib/isc/buffer.c