From d9538e7412c593a9dc10a600676939d2cf0205ea Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 28 May 2004 13:23:30 +0000 Subject: r937: - added a simple QuerySecurity implementation in samr server - moved some sec desc defines into misc.idl - fixed pw_len field in UserInfo26 - made some pipes available on TCP - added netr_DsrEnumerateDomainTrusts() to netlogon - added templates for remaining netlogon IDL calls (from ethereal) - added a unistr_noterm vs unistr error detector in ndr basic decoder - added torture test for netr_DsrEnumerateDomainTrusts() (This used to be commit ae5a5113fb83640dcb9ae4642c1b9eaf28487956) --- source4/librpc/ndr/ndr_basic.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source4/librpc/ndr/ndr_basic.c') diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c index 1766d47e14..f8315b3af0 100644 --- a/source4/librpc/ndr/ndr_basic.c +++ b/source4/librpc/ndr/ndr_basic.c @@ -413,6 +413,18 @@ NTSTATUS ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, const char **s) "Bad character conversion"); } NDR_CHECK(ndr_pull_advance(ndr, len2*2)); + + /* this is a way of detecting if a string is sent with the wrong + termination */ + if (ndr->flags & LIBNDR_FLAG_STR_NOTERM) { + if (strlen(as) < len2) { + DEBUG(6,("short string '%s'\n", as)); + } + } else { + if (strlen(as) == len2) { + DEBUG(6,("long string '%s'\n", as)); + } + } *s = as; break; -- cgit