CVSROOT:        /cvs
Module name:    src
Changes by:     [email protected] 2026/06/21 13:28:07

Modified files:
        lib/libc/asr   : gethostnamadr_async.c 

Log message:
Skip aliases that are not valid hostnames in gethostbyname(3).

Consider the following CNAME chain:

chain7.narrans.de.      60      IN      CNAME   chain\007.tlakh.xyz.
chain\007.tlakh.xyz.    60      IN      CNAME   chain.sha256.net.
chain.sha256.net.       60      IN      CNAME   sha256.net.
sha256.net.             60      IN      A       213.239.192.17

gethostbyname(3) would fail the query when it encounters
chain\007.tlakh.xyz. and tries to add it to h_aliases member of struct
hostent because it's not a valid hostname. This in turn would fail the
whole query.

With this, resolution succeeds and we get an alias list of
"chain7.narrans.de chain.sha256.net".

hostent_add_alias() can no longer fail, so make it void.

Noticed by dgl while we were working on something else.

OK deraadt

Reply via email to