3380. [bug] named could die if a non-existant master list was

referenced in a also-notify. [RT #31004]
This commit is contained in:
Mark Andrews
2012-09-26 15:28:46 +10:00
parent 7f1fab8b88
commit 8e4dd15561
2 changed files with 10 additions and 9 deletions

View File

@@ -1,3 +1,6 @@
3380. [bug] named could die if a non-existant master list was
referenced in a also-notify. [RT #31004]
3379. [bug] isc_interval_zero and isc_time_epoch should be
"const (type)* const". [RT #31069]

View File

@@ -601,14 +601,13 @@ ns_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
if (isc_sockaddr_getport(&addrs[i]) == 0)
isc_sockaddr_setport(&addrs[i], port);
keys[i] = NULL;
if (!cfg_obj_isstring(key)) {
i++;
i++; /* Increment here so that cleanup on error works. */
if (!cfg_obj_isstring(key))
continue;
}
keys[i] = isc_mem_get(mctx, sizeof(dns_name_t));
if (keys[i] == NULL)
keys[i - 1] = isc_mem_get(mctx, sizeof(dns_name_t));
if (keys[i - 1] == NULL)
goto cleanup;
dns_name_init(keys[i], NULL);
dns_name_init(keys[i - 1], NULL);
keystr = cfg_obj_asstring(key);
isc_buffer_init(&b, keystr, strlen(keystr));
@@ -619,10 +618,9 @@ ns_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
if (result != ISC_R_SUCCESS)
goto cleanup;
result = dns_name_dup(dns_fixedname_name(&fname), mctx,
keys[i]);
keys[i - 1]);
if (result != ISC_R_SUCCESS)
goto cleanup;
i++;
}
if (pushed != 0) {
pushed--;
@@ -678,7 +676,7 @@ ns_config_getipandkeylist(const cfg_obj_t *config, const cfg_obj_t *list,
if (addrs != NULL)
isc_mem_put(mctx, addrs, addrcount * sizeof(isc_sockaddr_t));
if (keys != NULL) {
for (j = 0; j <= i; j++) {
for (j = 0; j < i; j++) {
if (keys[j] == NULL)
continue;
if (dns_name_dynamic(keys[j]))