mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-10-01 22:24:55 +02:00
prettier, now for the zone syntax check.
git-svn-id: file:///svn/unbound/trunk@3637 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
+11
-8
@@ -931,15 +931,18 @@ int ub_ctx_set_stub(struct ub_ctx* ctx, const char* zone, const char* addr,
|
||||
struct config_stub **prev, *elem;
|
||||
|
||||
/* check syntax for zone name */
|
||||
uint8_t* nm;
|
||||
int nmlabs;
|
||||
size_t nmlen;
|
||||
if(!parse_dname(zone, &nm, &nmlen, &nmlabs)) {
|
||||
errno=EINVAL;
|
||||
return UB_SYNTAX; /* should have zone name, or "." for root */
|
||||
if(zone) {
|
||||
uint8_t* nm;
|
||||
int nmlabs;
|
||||
size_t nmlen;
|
||||
if(!parse_dname(zone, &nm, &nmlen, &nmlabs)) {
|
||||
errno=EINVAL;
|
||||
return UB_SYNTAX;
|
||||
}
|
||||
free(nm);
|
||||
} else {
|
||||
zone = ".";
|
||||
}
|
||||
free(nm);
|
||||
nm = NULL;
|
||||
|
||||
/* check syntax for addr (if not NULL) */
|
||||
if(addr) {
|
||||
|
||||
Reference in New Issue
Block a user