From 82fd60e904d93ef38c43cee423b668c1327f22aa Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 11 Feb 2005 06:58:07 +0000 Subject: r5325: - expanded the NBT-WINS test to include scopes - fixed the bugs that the new test found (This used to be commit 6d775f12168d51ce92a3f7e17f4bf06357d41a06) --- source4/libcli/nbt/nbtname.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source4/libcli') 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;iscope)+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; } -- cgit