summaryrefslogtreecommitdiff
path: root/source/nsswitch
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-05-06 17:02:31 +0200
committerKarolin Seeger <kseeger@samba.org>2008-05-07 11:03:16 +0200
commit6062c6eedcb1cccb103c44a2ff7f40e9eac87cb6 (patch)
tree300bc835486a69ea8564f1f07c9de8b2b6bec17e /source/nsswitch
parentd111b6bc559bc3340a3a98244fe642ac9a71a9dc (diff)
downloadsamba-6062c6eedcb1cccb103c44a2ff7f40e9eac87cb6.tar.gz
wins: fix null pointer crash in nss_wins module.
Guenther (cherry picked from commit 5bf47ebf0fb9f7d94ed36bce6bcaa31b508009bd) (cherry picked from commit d4984ac18a907773134cc906c689655338d3949e)
Diffstat (limited to 'source/nsswitch')
-rw-r--r--source/nsswitch/wins.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/nsswitch/wins.c b/source/nsswitch/wins.c
index 36415c42b59..7d42381986d 100644
--- a/source/nsswitch/wins.c
+++ b/source/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;
}