nss_dns: Check address length before creating addrinfo result [BZ #19831]
authorFlorian Weimer <fweimer@redhat.com>
Wed, 27 Apr 2016 14:39:12 +0000 (16:39 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Wed, 27 Apr 2016 14:39:12 +0000 (16:39 +0200)
commit5e0c421cc07e2d06945b863ed3bb92395472705d
tree6f06b7453f7ce8bddf128fed1aba799dad88f5a5
parentb9b026c9c00db1a1b5b4a3caa28162655a04a882
nss_dns: Check address length before creating addrinfo result [BZ #19831]

Previously, we allocated room in the result space before the check,
leaving uninitialized data there in case the check failed.

This also consolidates the behavior between single (A or AAAA) and
dual (A and AAAA in parallel) queries.  Single queries checked
the record length against the QTYPE, not the RRTYPE.
ChangeLog
resolv/nss_dns/dns-host.c