assert in udns_resolver.c:788

serge rasnikov 747500 at gmail.com
Fri May 27 22:49:40 MSD 2005


2005/5/26, Michael Tokarev <mjt at corpit.ru>:
> serge rasnikov wrote:
> > Hello.
> >
> > sorry for stupid question :-), but..
> >
> > udns_resolver.c:788: dns_end_query: Assertion `(status < 0 &&
> > result == 0) || (status >= 0 && result != 0)' failed.
> >
> > is bug in my programm or not?
> 
> No it is not a bug in your code, it's a bug in udns, a known
> one.  The following patch:
> 
> --- udns_resolver.c     5 May 2005 19:16:43 -0000       1.51
> +++ udns_resolver.c     8 May 2005 12:54:31 -0000       1.52
> @@ -1142,8 +1142,11 @@ again:
>        break;
>      }
>      /* the only case where we may succeed */
> -    if (q->dnsq_parse)
> +    if (q->dnsq_parse) {
>        r = q->dnsq_parse(dns_payload(q->dnsq_buf), pbuf, pcur, pend, &result);
> +      if (r < 0)
> +        result = NULL;
> +    }
>      else if ((result = malloc(r)) != NULL)
>        memcpy(result, pbuf, r);
>      else
> 
> will fix the issue, which only happens when one query in a row of
> several returns NODATA result.
> 
> Which reminds me I should upload the fixed version.
> 

Thanks and respect. The great lib.

I can contrubute sample code with unds + libevent
(http://www.monkey.org/~provos/libevent/) integration.
I have spent for it one working day (night :-), and next time someone
can make it for 10 minutes.

It is interesting to you?

-- 
Serge


More information about the udns mailing list