summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-05-06 17:02:31 +0200
committerGünther Deschner <gd@samba.org>2008-05-07 10:39:21 +0200
commit8ce3f6b840a259133e2b2cfdb97578e96c94b629 (patch)
tree67865e25ebc108eb5f956bed69607d8b0e0fdffa /source3
parent82572cfd4370fbcfbe35f1d5f11fb05fc732cba2 (diff)
downloadsamba-8ce3f6b840a259133e2b2cfdb97578e96c94b629.tar.gz
samba-8ce3f6b840a259133e2b2cfdb97578e96c94b629.tar.bz2
samba-8ce3f6b840a259133e2b2cfdb97578e96c94b629.zip
wins: fix null pointer crash in nss_wins module.
Guenther (This used to be commit 5bf47ebf0fb9f7d94ed36bce6bcaa31b508009bd)
Diffstat (limited to 'source3')
-rw-r--r--source3/nsswitch/wins.c3
1 files changed, 3 insertions, 0 deletions
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;
}