2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 22:15:20 +00:00

1208. [bug] Adjusted REQUIRE's in lib/dns/name.c to better

reflect written requirements.
This commit is contained in:
Mark Andrews
2002-05-29 00:27:53 +00:00
parent da091cda77
commit 8f96645217
2 changed files with 14 additions and 4 deletions

View File

@@ -1,3 +1,6 @@
1208. [bug] Adjusted REQUIRE's in lib/dns/name.c to better
reflect written requirements.
1207. [bug] REQUIRE that DNS_DBADD_MERGE only be set when adding
a rdataset to a zone db in the rbtdb implementation of
addrdataset.

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: name.c,v 1.134 2002/05/28 03:39:46 marka Exp $ */
/* $Id: name.c,v 1.135 2002/05/29 00:27:53 marka Exp $ */
#include <config.h>
@@ -1152,7 +1152,7 @@ dns_name_fromtext(dns_name_t *name, isc_buffer_t *source,
REQUIRE(VALID_NAME(name));
REQUIRE(ISC_BUFFER_VALID(source));
REQUIRE((target != NULL && ISC_BUFFER_VALID(target)) ||
(target == NULL && name->buffer != NULL));
(target == NULL && ISC_BUFFER_VALID(name->buffer)));
if (target == NULL && name->buffer != NULL) {
target = name->buffer;
@@ -2075,7 +2075,8 @@ dns_name_downcase(dns_name_t *source, dns_name_t *name, isc_buffer_t *target) {
ndata = source->ndata;
} else {
REQUIRE(BINDABLE(name));
REQUIRE(target != NULL || name->buffer != NULL);
REQUIRE((target != NULL && ISC_BUFFER_VALID(target)) ||
(target == NULL && ISC_BUFFER_VALID(name->buffer)));
if (target == NULL) {
target = name->buffer;
isc_buffer_clear(name->buffer);
@@ -2365,6 +2366,8 @@ dns_name_fromwire(dns_name_t *name, isc_buffer_t *source,
*/
REQUIRE(VALID_NAME(name));
REQUIRE((target != NULL && ISC_BUFFER_VALID(target)) ||
(target == NULL && ISC_BUFFER_VALID(name->buffer)));
if (target == NULL && name->buffer != NULL) {
target = name->buffer;
@@ -2563,6 +2566,7 @@ dns_name_towire(dns_name_t *name, dns_compress_t *cctx, isc_buffer_t *target) {
REQUIRE(VALID_NAME(name));
REQUIRE(cctx != NULL);
REQUIRE(ISC_BUFFER_VALID(target));
/*
* If 'name' doesn't have an offsets table, make a clone which
@@ -2640,6 +2644,8 @@ dns_name_concatenate(dns_name_t *prefix, dns_name_t *suffix, dns_name_t *name,
REQUIRE(prefix == NULL || VALID_NAME(prefix));
REQUIRE(suffix == NULL || VALID_NAME(suffix));
REQUIRE(name == NULL || VALID_NAME(name));
REQUIRE((target != NULL && ISC_BUFFER_VALID(target)) ||
(target == NULL && name != NULL && ISC_BUFFER_VALID(name->buffer)));
if (prefix == NULL || prefix->labels == 0)
copy_prefix = ISC_FALSE;
if (suffix == NULL || suffix->labels == 0)
@@ -2653,7 +2659,8 @@ dns_name_concatenate(dns_name_t *prefix, dns_name_t *suffix, dns_name_t *name,
DNS_NAME_INIT(&tmp_name, odata);
name = &tmp_name;
}
if (target == NULL && name->buffer != NULL) {
if (target == NULL) {
INSIST(name->buffer != NULL);
target = name->buffer;
isc_buffer_clear(name->buffer);
}