summaryrefslogtreecommitdiff
path: root/source3/winbindd
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2013-08-12 20:22:04 +0200
committerAndreas Schneider <asn@cryptomilk.org>2013-08-13 13:58:25 +0200
commit52d66d81f1a873b8106973d1cdece032b7080805 (patch)
tree80f3fa4f192cb6cc24b8942fe642a0f6fa59443f /source3/winbindd
parentdc3c4c00e65f1ffdd32bf7c2e957da98b5913084 (diff)
downloadsamba-52d66d81f1a873b8106973d1cdece032b7080805.tar.gz
samba-52d66d81f1a873b8106973d1cdece032b7080805.tar.bz2
samba-52d66d81f1a873b8106973d1cdece032b7080805.zip
s3-winbind: Fix a segfault passing NULL to a fstring argument.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10082 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Aug 13 13:58:26 CEST 2013 on sn-devel-104
Diffstat (limited to 'source3/winbindd')
-rw-r--r--source3/winbindd/winbindd_cm.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index 6c3f6eadf2..08c763c8d8 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -1127,6 +1127,7 @@ static bool dcip_to_name(TALLOC_CTX *mem_ctx,
uint32_t nt_version = NETLOGON_NT_VERSION_1;
NTSTATUS status;
const char *dc_name;
+ fstring nbtname;
ip_list.ss = *pss;
ip_list.port = 0;
@@ -1210,9 +1211,17 @@ static bool dcip_to_name(TALLOC_CTX *mem_ctx,
/* try node status request */
- if (name_status_find(domain->name, 0x1c, 0x20, pss, *name) ) {
+ if (name_status_find(domain->name, 0x1c, 0x20, pss, nbtname) ) {
namecache_store(*name, 0x20, 1, &ip_list);
- return True;
+
+ if (name != NULL) {
+ *name = talloc_strdup(mem_ctx, nbtname);
+ if (*name == NULL) {
+ return false;
+ }
+ }
+
+ return true;
}
return False;
}