summaryrefslogtreecommitdiff
path: root/source4/libcli/nbt/namequery.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libcli/nbt/namequery.c')
-rw-r--r--source4/libcli/nbt/namequery.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source4/libcli/nbt/namequery.c b/source4/libcli/nbt/namequery.c
index a9748c7bd2..f222148f4d 100644
--- a/source4/libcli/nbt/namequery.c
+++ b/source4/libcli/nbt/namequery.c
@@ -98,7 +98,7 @@ NTSTATUS nbt_name_query_recv(struct nbt_name_request *req,
io->out.name = packet->answers[0].name;
io->out.num_addrs = packet->answers[0].rdata.netbios.length / 6;
- io->out.reply_addrs = talloc_array(mem_ctx, const char *, io->out.num_addrs);
+ io->out.reply_addrs = talloc_array(mem_ctx, const char *, io->out.num_addrs+1);
if (io->out.reply_addrs == NULL) {
talloc_free(req);
return NT_STATUS_NO_MEMORY;
@@ -108,6 +108,7 @@ NTSTATUS nbt_name_query_recv(struct nbt_name_request *req,
io->out.reply_addrs[i] = talloc_steal(mem_ctx,
packet->answers[0].rdata.netbios.addresses[i].ipaddr);
}
+ io->out.reply_addrs[i] = NULL;
talloc_steal(mem_ctx, io->out.name.name);
talloc_steal(mem_ctx, io->out.name.scope);