From 2a04cf92219aed3381e1c49699c1f6b485a190a8 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 16 Jan 2005 03:44:08 +0000 Subject: r4772: fixed checking of the conformant size for dom_sid2 (This used to be commit 0d31523aaed7a8995970dc9933a6a9d9b8536ee0) --- source4/librpc/ndr/ndr_sec.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source4/librpc/ndr') diff --git a/source4/librpc/ndr/ndr_sec.c b/source4/librpc/ndr/ndr_sec.c index 798d3a7cf1..5adff6b0ce 100644 --- a/source4/librpc/ndr/ndr_sec.c +++ b/source4/librpc/ndr/ndr_sec.c @@ -35,7 +35,13 @@ NTSTATUS ndr_pull_dom_sid2(struct ndr_pull *ndr, int ndr_flags, struct dom_sid * return NT_STATUS_OK; } NDR_CHECK(ndr_pull_uint32(ndr, &num_auths)); - return ndr_pull_dom_sid(ndr, ndr_flags, sid); + NDR_CHECK(ndr_pull_dom_sid(ndr, ndr_flags, sid)); + if (sid->num_auths != num_auths) { + return ndr_pull_error(ndr, NDR_ERR_CONFORMANT_SIZE, + "Bad conformant size %u should be %u", + num_auths, sid->num_auths); + } + return NT_STATUS_OK; } /* -- cgit