summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-02-11 06:58:07 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:09:41 -0500
commit82fd60e904d93ef38c43cee423b668c1327f22aa (patch)
tree5bebfd5482c64afd4715ab61f340c6968478d99e /source4/libcli
parent9515fc4406464b6a015a06d89ca0370810977486 (diff)
downloadsamba-82fd60e904d93ef38c43cee423b668c1327f22aa.tar.gz
samba-82fd60e904d93ef38c43cee423b668c1327f22aa.tar.bz2
samba-82fd60e904d93ef38c43cee423b668c1327f22aa.zip
r5325: - expanded the NBT-WINS test to include scopes
- fixed the bugs that the new test found (This used to be commit 6d775f12168d51ce92a3f7e17f4bf06357d41a06)
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/nbt/nbtname.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source4/libcli/nbt/nbtname.c b/source4/libcli/nbt/nbtname.c
index 7eb48e5b9e..1b53cb3ca6 100644
--- a/source4/libcli/nbt/nbtname.c
+++ b/source4/libcli/nbt/nbtname.c
@@ -202,12 +202,13 @@ NTSTATUS ndr_pull_nbt_name(struct ndr_pull *ndr, int ndr_flags, struct nbt_name
/* combine the remaining components into the scope */
scope = components[1];
for (i=2;i<num_components;i++) {
- talloc_asprintf_append(scope, ".%s", components[i]);
+ scope = talloc_asprintf_append(scope, ".%s", components[i]);
+ NT_STATUS_HAVE_NO_MEMORY(scope);
}
if (scope) {
ret = convert_string_talloc(ndr, CH_DOS, CH_UNIX, scope,
- strlen(r->scope)+1, &p);
+ strlen(scope)+1, &p);
if (ret <= 0) {
return NT_STATUS_BAD_NETWORK_NAME;
}
@@ -265,10 +266,12 @@ NTSTATUS ndr_push_nbt_name(struct ndr_push *ndr, int ndr_flags, struct nbt_name
num_components < MAX_COMPONENTS) {
*p = 0;
components[num_components] = dscope;
- NT_STATUS_HAVE_NO_MEMORY(components[num_components]);
dscope = p+1;
num_components++;
}
+ if (dscope && num_components < MAX_COMPONENTS) {
+ components[num_components++] = dscope;
+ }
if (num_components == MAX_COMPONENTS) {
return NT_STATUS_BAD_NETWORK_NAME;
}