Commit 18fa89b0 authored by Mark Andrews's avatar Mark Andrews
Browse files

check returns from putstr and putnull

parent 4ac862fa
...@@ -8018,21 +8018,21 @@ ns_server_validation(ns_server_t *server, char *args, isc_buffer_t **text) { ...@@ -8018,21 +8018,21 @@ ns_server_validation(ns_server_t *server, char *args, isc_buffer_t **text) {
continue; continue;
result = dns_view_flushcache(view); result = dns_view_flushcache(view);
if (result != ISC_R_SUCCESS) if (result != ISC_R_SUCCESS)
goto out; goto cleanup;
if (set) { if (set) {
view->enablevalidation = enable; view->enablevalidation = enable;
changed = ISC_TRUE; changed = ISC_TRUE;
} else { } else {
if (!first) if (!first)
putstr(text, "\n"); CHECK(putstr(text, "\n"));
putstr(text, "DNSSEC validation is "); CHECK(putstr(text, "DNSSEC validation is "));
putstr(text, view->enablevalidation CHECK(putstr(text, view->enablevalidation
? "enabled" : "disabled"); ? "enabled" : "disabled"));
putstr(text, " (view "); CHECK(putstr(text, " (view "));
putstr(text, view->name); CHECK(putstr(text, view->name));
putstr(text, ")"); CHECK(putstr(text, ")"));
putnull(text); CHECK(putnull(text));
first = ISC_FALSE; first = ISC_FALSE;
} }
} }
...@@ -8043,7 +8043,7 @@ ns_server_validation(ns_server_t *server, char *args, isc_buffer_t **text) { ...@@ -8043,7 +8043,7 @@ ns_server_validation(ns_server_t *server, char *args, isc_buffer_t **text) {
result = ISC_R_SUCCESS; result = ISC_R_SUCCESS;
else else
result = ISC_R_FAILURE; result = ISC_R_FAILURE;
out: cleanup:
isc_task_endexclusive(server->task); isc_task_endexclusive(server->task);
return (result); return (result);
} }
...@@ -8546,7 +8546,7 @@ list_keynames(dns_view_t *view, dns_tsig_keyring_t *ring, isc_buffer_t **text, ...@@ -8546,7 +8546,7 @@ list_keynames(dns_view_t *view, dns_tsig_keyring_t *ring, isc_buffer_t **text,
dns_name_format(tkey->creator, creatorstr, dns_name_format(tkey->creator, creatorstr,
sizeof(creatorstr)); sizeof(creatorstr));
if (*foundkeys != 0) if (*foundkeys != 0)
putstr(text, "\n"); CHECK(putstr(text, "\n"));
CHECK(putstr(text, "view \"")); CHECK(putstr(text, "view \""));
CHECK(putstr(text, viewname)); CHECK(putstr(text, viewname));
CHECK(putstr(text, CHECK(putstr(text,
...@@ -8557,7 +8557,7 @@ list_keynames(dns_view_t *view, dns_tsig_keyring_t *ring, isc_buffer_t **text, ...@@ -8557,7 +8557,7 @@ list_keynames(dns_view_t *view, dns_tsig_keyring_t *ring, isc_buffer_t **text,
CHECK(putstr(text, "\";")); CHECK(putstr(text, "\";"));
} else { } else {
if (*foundkeys != 0) if (*foundkeys != 0)
putstr(text, "\n"); CHECK(putstr(text, "\n"));
CHECK(putstr(text, "view \"")); CHECK(putstr(text, "view \""));
CHECK(putstr(text, viewname)); CHECK(putstr(text, viewname));
CHECK(putstr(text, CHECK(putstr(text,
...@@ -8609,12 +8609,15 @@ ns_server_tsiglist(ns_server_t *server, isc_buffer_t **text) { ...@@ -8609,12 +8609,15 @@ ns_server_tsiglist(ns_server_t *server, isc_buffer_t **text) {
isc_task_endexclusive(server->task); isc_task_endexclusive(server->task);
if (foundkeys == 0) if (foundkeys == 0)
putstr(text, "no tsig keys found."); CHECK(putstr(text, "no tsig keys found."));
if (isc_buffer_usedlength(*text) > 0) if (isc_buffer_usedlength(*text) > 0)
putnull(text); CHECK(putnull(text));
return (ISC_R_SUCCESS); return (ISC_R_SUCCESS);
cleanup:
return (result);
} }
/* /*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment