From d3569ca2711d21ac87ff539662333ad315a2a618 Mon Sep 17 00:00:00 2001 From: Tom Mortensen Date: Sat, 16 Apr 2016 10:57:12 +0200 Subject: nss_wins: ip_pton expects the raw IP address Signed-off-by: Tom Mortensen Reviewed-by: Volker Lendecke Reviewed-by: Jeremy Allison --- nsswitch/wins.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'nsswitch') diff --git a/nsswitch/wins.c b/nsswitch/wins.c index 3243ffb5bff..22524e46461 100644 --- a/nsswitch/wins.c +++ b/nsswitch/wins.c @@ -47,7 +47,7 @@ NSS_STATUS _nss_wins_gethostbyname2_r(const char *name, int af, struct hostent * static char *lookup_byname_backend(const char *name) { const char *p; - char *ip; + char *ip, *ipp; size_t nbt_len; wbcErr result; @@ -65,6 +65,11 @@ static char *lookup_byname_backend(const char *name) return NULL; } + ipp = strchr(ip, '\t'); + if (ipp != NULL) { + *ipp = '\0'; + } + return ip; } -- cgit v1.2.1