mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-27 12:13:20 -04:00
Use 'bname' in dns_catz_update_from_db() only when it is ready
There is a possible code path of using the uninitialized `bname`
character array while logging an error message.
Initialize the `bname` buffer earlier in the function.
Also, change the initialization routine to use a helper function.
(cherry picked from commit a5a6362e92)
This commit is contained in:
parent
68bbce9813
commit
a20acee77d
1 changed files with 2 additions and 5 deletions
|
|
@ -1798,12 +1798,13 @@ dns_catz_update_from_db(dns_db_t *db, dns_catz_zones_t *catzs) {
|
|||
dns_rdatasetiter_t *rdsiter = NULL;
|
||||
dns_rdataset_t rdataset;
|
||||
char bname[DNS_NAME_FORMATSIZE];
|
||||
isc_buffer_t ibname;
|
||||
uint32_t vers;
|
||||
|
||||
REQUIRE(DNS_DB_VALID(db));
|
||||
REQUIRE(DNS_CATZ_ZONES_VALID(catzs));
|
||||
|
||||
dns_name_format(&db->origin, bname, DNS_NAME_FORMATSIZE);
|
||||
|
||||
/*
|
||||
* Create a new catz in the same context as current catz.
|
||||
*/
|
||||
|
|
@ -1817,10 +1818,6 @@ dns_catz_update_from_db(dns_db_t *db, dns_catz_zones_t *catzs) {
|
|||
return;
|
||||
}
|
||||
|
||||
isc_buffer_init(&ibname, bname, DNS_NAME_FORMATSIZE);
|
||||
result = dns_name_totext(&db->origin, true, &ibname);
|
||||
INSIST(result == ISC_R_SUCCESS);
|
||||
|
||||
result = dns_db_getsoaserial(db, oldzone->dbversion, &vers);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
/* A zone without SOA record?!? */
|
||||
|
|
|
|||
Loading…
Reference in a new issue