As per RFC 1035.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14378
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
int ndr_flags,
const char *s)
{
+ const char *start = s;
+
if (!(ndr_flags & NDR_SCALARS)) {
return NDR_ERR_SUCCESS;
}
talloc_free(compname);
s += complen;
- if (*s == '.') s++;
+ if (*s == '.') {
+ s++;
+ }
+ if (s - start > 255) {
+ return ndr_push_error(ndr, NDR_ERR_STRING,
+ "name > 255 character long");
+ }
}
/* if we reach the end of the string and have pushed the last component
-librpc.ndr.ndr_dns_nbt.test_ndr_dns_string_half_dots
librpc.ndr.ndr_dns_nbt.test_ndr_nbt_string_all_dots
librpc.ndr.ndr_dns_nbt.test_ndr_nbt_string_half_dots