mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 15:05:23 +00:00
Don't crash the server when a user enters a NULL zone.
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: server.c,v 1.254 2000/11/25 03:27:53 mws Exp $ */
|
/* $Id: server.c,v 1.255 2000/11/25 03:55:43 mws Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
@@ -2128,7 +2128,7 @@ zone_from_args(char *args, dns_zone_t **zone) {
|
|||||||
}
|
}
|
||||||
ptr = next_token(&input, " \t");
|
ptr = next_token(&input, " \t");
|
||||||
}
|
}
|
||||||
if (zonetxt == NULL)
|
if ((zonetxt == NULL) || (zonetxt[0] == 0))
|
||||||
return DNS_R_BADZONE; /* Nothing to do! */
|
return DNS_R_BADZONE; /* Nothing to do! */
|
||||||
isc_buffer_init(&buf, zonetxt, strlen(zonetxt));
|
isc_buffer_init(&buf, zonetxt, strlen(zonetxt));
|
||||||
isc_buffer_add(&buf, strlen(zonetxt));
|
isc_buffer_add(&buf, strlen(zonetxt));
|
||||||
@@ -2137,7 +2137,7 @@ zone_from_args(char *args, dns_zone_t **zone) {
|
|||||||
ISC_FALSE, NULL);
|
ISC_FALSE, NULL);
|
||||||
if (result != ISC_R_SUCCESS)
|
if (result != ISC_R_SUCCESS)
|
||||||
goto fail1;
|
goto fail1;
|
||||||
if (viewtxt == NULL)
|
if ((viewtxt == NULL) || (viewtxt[0] == 0))
|
||||||
viewtxt = "_default";
|
viewtxt = "_default";
|
||||||
result = dns_viewlist_find(&ns_g_server->viewlist, viewtxt,
|
result = dns_viewlist_find(&ns_g_server->viewlist, viewtxt,
|
||||||
dns_rdataclass_in, &view);
|
dns_rdataclass_in, &view);
|
||||||
|
Reference in New Issue
Block a user