summaryrefslogtreecommitdiff
path: root/librpc/ndr/ndr_dnsp.c
diff options
context:
space:
mode:
Diffstat (limited to 'librpc/ndr/ndr_dnsp.c')
-rw-r--r--librpc/ndr/ndr_dnsp.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/librpc/ndr/ndr_dnsp.c b/librpc/ndr/ndr_dnsp.c
index ae78425c55..daf8fffdef 100644
--- a/librpc/ndr/ndr_dnsp.c
+++ b/librpc/ndr/ndr_dnsp.c
@@ -95,7 +95,13 @@ enum ndr_err_code ndr_push_dnsp_name(struct ndr_push *ndr, int ndr_flags, const
for (count=i=0; name[i]; i++) {
if (name[i] == '.') count++;
}
- total_len = strlen(name) + 1 + 1;
+ total_len = strlen(name) + 1;
+
+ /* cope with names ending in '.' */
+ if (name[strlen(name)-1] != '.') {
+ total_len++;
+ count++;
+ }
if (total_len > 255 || count > 255) {
return ndr_push_error(ndr, NDR_ERR_BUFSIZE,
"dns_name of length %d larger than 255", total_len);