mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Remove illogical condition from isc_buffer_reallocate that would return ISC_R_NOSPACE when requested size is less than available size
This commit is contained in:
parent
519bfe4c97
commit
7785f644c3
2 changed files with 0 additions and 9 deletions
|
|
@ -576,9 +576,6 @@ isc_buffer_reallocate(isc_buffer_t **dynbuffer, unsigned int length) {
|
|||
REQUIRE(ISC_BUFFER_VALID(*dynbuffer));
|
||||
REQUIRE((*dynbuffer)->mctx != NULL);
|
||||
|
||||
if ((*dynbuffer)->length > length)
|
||||
return (ISC_R_NOSPACE);
|
||||
|
||||
/*
|
||||
* XXXMUKS: This is far more expensive than plain realloc() as
|
||||
* it doesn't remap pages, but does ordinary copy. So is
|
||||
|
|
|
|||
|
|
@ -114,12 +114,6 @@ ATF_TC_BODY(isc_buffer_reallocate, tc) {
|
|||
ATF_REQUIRE(b != NULL);
|
||||
ATF_CHECK_EQ(b->length, 1024);
|
||||
|
||||
result = isc_buffer_reallocate(&b, 512);
|
||||
ATF_CHECK_EQ(result, ISC_R_NOSPACE);
|
||||
ATF_CHECK(ISC_BUFFER_VALID(b));
|
||||
ATF_REQUIRE(b != NULL);
|
||||
ATF_CHECK_EQ(b->length, 1024);
|
||||
|
||||
result = isc_buffer_reallocate(&b, 1536);
|
||||
ATF_CHECK_EQ(result, ISC_R_SUCCESS);
|
||||
ATF_CHECK(ISC_BUFFER_VALID(b));
|
||||
|
|
|
|||
Loading…
Reference in a new issue