udns_resolver.c:916: dns_submit_dn: Assertion `q->dnsq_origdnl0 > 0' failed.

Michael Tokarev mjt at tls.msk.ru
Tue Jul 5 18:05:18 MSD 2011


05.07.2011 17:46, Iñaki Baz Castillo wrote:
> 2011/7/5 Iñaki Baz Castillo <ibc at aliax.net>:
>> Hi, note that I don't mean "a._" but "a. _" (with space, so you must
>> enclose the string between "" to pass it as a single argument to the
>> call).
>> Sorry, I was wrong, please use ".a _".
> 
> I've tested your code with "a. _" and produces:
> 
>   .a _: valid domain but no data of requested type
> 
> However in my Ruby C extension (which uses udns asyncronously) it
> produces ("today") a timeout so tempfail.

Actually I found the problem.  the srv rr submitter does not
check validity of the names it were asked to resolve.  The
following patch should fix the issue.

diff --git a/udns_rr_srv.c b/udns_rr_srv.c
index 1b72f2e..500a663 100644
--- a/udns_rr_srv.c
+++ b/udns_rr_srv.c
@@ -107,22 +107,21 @@ static unsigned add_sname(dnsc_t *dn, const char *sn) {
 static int
 build_srv_dn(dnsc_t *dn, const char *name, const char *srv, const char *proto)
 {
-  unsigned p = 0, l;
-  int isabs;
+  int p = 0, l, isabs;
   if (srv) {
     l = add_sname(dn + p, srv);
-    if (!l)
+    if (l < 0)
       return -1;
     p += l;
   }
   if (proto) {
     l = add_sname(dn + p, proto);
-    if (!l)
+    if (l < 0)
       return -1;
     p += l;
   }
   l = dns_ptodn(name, 0, dn + p, DNS_MAXDN - p, &isabs);
-  if (!l)
+  if (l < 0)
     return -1;
   return isabs ? DNS_NOSRCH : 0;
 }


More information about the udns mailing list