summaryrefslogtreecommitdiff
path: root/source4/wrepl_server
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-10-14 12:55:27 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:42:33 -0500
commitb3d0ac41db7638bdd3539391c65e6e7bf9fdf7a9 (patch)
tree87df0925be960ae9528674bbaec7a2dc7b75db3f /source4/wrepl_server
parent2ecb46d595b880c533e2dafea43baf02f009bec6 (diff)
downloadsamba-b3d0ac41db7638bdd3539391c65e6e7bf9fdf7a9.tar.gz
samba-b3d0ac41db7638bdd3539391c65e6e7bf9fdf7a9.tar.bz2
samba-b3d0ac41db7638bdd3539391c65e6e7bf9fdf7a9.zip
r11038: r10351@SERNOX: metze | 2005-09-20 16:11:17 +0200
fix namebuf_len, when type is 0x00 metze (This used to be commit 1b2effa01bf16f9575e7e43e037a0797f98426b8)
Diffstat (limited to 'source4/wrepl_server')
-rw-r--r--source4/wrepl_server/wrepl_in_call.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source4/wrepl_server/wrepl_in_call.c b/source4/wrepl_server/wrepl_in_call.c
index 6dd1c0fe47..ab86aa209f 100644
--- a/source4/wrepl_server/wrepl_in_call.c
+++ b/source4/wrepl_server/wrepl_in_call.c
@@ -169,13 +169,19 @@ static NTSTATUS wreplsrv_record2wins_name(TALLOC_CTX *mem_ctx, struct wrepl_wins
}
namebuf = (uint8_t *)talloc_asprintf(mem_ctx, "%-15s%c%s",
- rec->name->name, rec->name->type,
+ rec->name->name, 'X',
(rec->name->scope?rec->name->scope:""));
NT_STATUS_HAVE_NO_MEMORY(namebuf);
namebuf_len = strlen((char *)namebuf) + 1;
+ /*
+ * we need to set the type here, and use a place-holder in the talloc_asprintf()
+ * as the type can be 0x00, and then the namebuf_len = strlen(namebuf); would give wrong results
+ */
+ namebuf[15] = rec->name->type;
+
/* oh wow, what a nasty bug in windows ... */
- if (namebuf[15] == 0x1b && namebuf_len >= 16) {
+ if (rec->name->type == 0x1b) {
namebuf[15] = namebuf[0];
namebuf[0] = 0x1b;
}