summaryrefslogtreecommitdiff
path: root/librpc
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2012-02-28 13:58:48 +1100
committerAmitay Isaacs <amitay@gmail.com>2012-03-02 00:24:49 +1100
commitc46763419aac3165f0eafbbc786cc929129c5109 (patch)
treedb9e04baf9d7c2a9d64f3a42c8c7748979554639 /librpc
parentad1ef7948668d17c03009fad10d2d3fd01cacb77 (diff)
downloadsamba-c46763419aac3165f0eafbbc786cc929129c5109.tar.gz
samba-c46763419aac3165f0eafbbc786cc929129c5109.tar.bz2
samba-c46763419aac3165f0eafbbc786cc929129c5109.zip
ndr: Fix NDR push function for dnsp_string
Push the actual length of the string not including null-termination.
Diffstat (limited to 'librpc')
-rw-r--r--librpc/ndr/ndr_dnsp.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/librpc/ndr/ndr_dnsp.c b/librpc/ndr/ndr_dnsp.c
index 347fbed3fd..f341c82922 100644
--- a/librpc/ndr/ndr_dnsp.c
+++ b/librpc/ndr/ndr_dnsp.c
@@ -160,14 +160,13 @@ _PUBLIC_ enum ndr_err_code ndr_pull_dnsp_string(struct ndr_pull *ndr, int ndr_fl
enum ndr_err_code ndr_push_dnsp_string(struct ndr_push *ndr, int ndr_flags, const char *string)
{
int total_len;
- total_len = strlen(string) + 1;
+ total_len = strlen(string);
if (total_len > 255) {
return ndr_push_error(ndr, NDR_ERR_BUFSIZE,
"dns_name of length %d larger than 255", total_len);
}
NDR_CHECK(ndr_push_uint8(ndr, ndr_flags, (uint8_t)total_len));
- NDR_CHECK(ndr_push_bytes(ndr, (const uint8_t *)string, total_len - 1));
- NDR_PUSH_ALIGN(ndr, 1);
+ NDR_CHECK(ndr_push_bytes(ndr, (const uint8_t *)string, total_len));
return NDR_ERR_SUCCESS;
}