From 8ce3f6b840a259133e2b2cfdb97578e96c94b629 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 6 May 2008 17:02:31 +0200 Subject: wins: fix null pointer crash in nss_wins module. Guenther (This used to be commit 5bf47ebf0fb9f7d94ed36bce6bcaa31b508009bd) --- source3/nsswitch/wins.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source3/nsswitch/wins.c b/source3/nsswitch/wins.c index 36415c42b5..7d42381986 100644 --- a/source3/nsswitch/wins.c +++ b/source3/nsswitch/wins.c @@ -140,6 +140,9 @@ static struct in_addr *lookup_byname_backend(const char *name, int *count) in_addr_to_sockaddr_storage(&ss, *bcast); pss = name_query(fd,name,0x00,True,True,&ss,count, &flags, NULL); if (pss) { + if ((ret = SMB_MALLOC_P(struct in_addr)) == NULL) { + return NULL; + } *ret = ((struct sockaddr_in *)pss)->sin_addr; break; } -- cgit