Commit ac528278 authored by Bob Halley's avatar Bob Halley
Browse files

return YXDOMAIN if dname construction fails

parent 70fdfcd1
......@@ -838,9 +838,20 @@ query_find(ns_client_t *client) {
fname = query_newname(client, dbuf, &b);
if (fname == NULL)
goto cleanup;
fname->buffer->length = 20;
result = dns_name_concatenate(prefix, tname, fname, NULL);
if (result != ISC_R_SUCCESS)
if (result != ISC_R_SUCCESS) {
if (result == ISC_R_NOSPACE) {
/*
* draft-ietf-dnsind-dname-03.txt, section
* 4.1, subsection 3c says we should
* return YXDOMAIN if the constructed
* name would be too long.
*/
client->message->rcode = dns_rcode_yxdomain;
}
goto cleanup;
}
query_keepname(client, fname, dbuf);
client->query.qname = fname;
fname = NULL;
......
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