diff options
Diffstat (limited to 'librpc/ndr/ndr_dnsp.c')
-rw-r--r-- | librpc/ndr/ndr_dnsp.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/librpc/ndr/ndr_dnsp.c b/librpc/ndr/ndr_dnsp.c index 974ff5ebff2..d75c58fca37 100644 --- a/librpc/ndr/ndr_dnsp.c +++ b/librpc/ndr/ndr_dnsp.c @@ -106,8 +106,18 @@ enum ndr_err_code ndr_push_dnsp_name(struct ndr_push *ndr, int ndr_flags, const } total_len = strlen(name) + 1; - /* cope with names ending in '.' */ - if (name[strlen(name)-1] != '.') { + /* + * cope with names ending in '.' + */ + if (name[0] == '\0') { + /* + * Don't access name[-1] for the "" input, which has + * the same meaning as a lone '.'. + * + * This allows a round-trip of a dnsRecord from + * Windows of a MX record of '.' + */ + } else if (name[strlen(name)-1] != '.') { total_len++; count++; } |