nwrap_files_getaddrinfo: avoid crash on empty name
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Sun, 17 May 2020 01:14:08 +0000 (13:14 +1200)
committerAndreas Schneider <asn@samba.org>
Fri, 10 Jul 2020 13:54:39 +0000 (15:54 +0200)
commit86420d91ddc22d71ffeed4dcbc02bef0f6042cbe
treeeb77a143c22c99c6a416202c64eb6cd189d83e4d
parentb20ae4762af9ce0ca4bf798a26a46f171255f7bd
nwrap_files_getaddrinfo: avoid crash on empty name

When name is "", we would deref name[-1]. If by chance name[-1] was
'.', we also tried to copy all of memory from one place to another.

Rather than just guard the immediate next branch, let's assume the
empty name is never found.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
src/nss_wrapper.c