dns_submit_srv() crashes if 'service' is string but 'protocol' is NULL

Iñaki Baz Castillo ibc at aliax.net
Tue Feb 8 03:14:37 MSK 2011


Hi, dns_submit_srv() allows setting both service and protocol or no
one of them. However if 'service' is a set but 'protocol' is not, then
the following function crashes:

build_srv_dn(dnsc_t *dn, const char *name, const char *srv, const char *proto)
{
  unsigned p = 0, l;
  int isabs;
  if (srv) {
    l = add_sname(dn + p, srv);
    if (!l)
      return -1;
    p += l;
    l = add_sname(dn + p, proto);
    if (!l)
      return -1;
    p += l;
  }

Maybe the function should check it?

Regards.


-- 
Iñaki Baz Castillo
<ibc at aliax.net>


More information about the udns mailing list