pidl: Avoid leaving array_size NDR tokens around
authorAndrew Bartlett <abartlet@samba.org>
Sat, 22 May 2021 06:40:13 +0000 (18:40 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Wed, 2 Jun 2021 03:56:36 +0000 (03:56 +0000)
commit3bc680c1e38bef75d5b212992e15f094c523923b
treee49d92cfa4079786a243329868a80d86a7916ad0
parenta7d4f93cfdee0a2005be11880f8dd31f55149369
pidl: Avoid leaving array_size NDR tokens around

In many cases these can and should be consumed as soon as
they are used.

This is not a complete fix, we don't clean up the array_size
token after using it split between an NDR_SCALARS and
an NDR_BUFFERS pass, but it is much better than it was
and helps the winbind case with a large number of groups
(eg 100,000) as otherwise we hit the 65535 NDR token limit.

(This is an arbitary Samba-only limit to avoid DoS conditions)

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14710

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
librpc/ABI/ndr-2.0.0.sigs
librpc/ndr/libndr.h
librpc/ndr/ndr.c
librpc/ndr/ndr_negoex.c
librpc/ndr/ndr_spoolss_buf.c
pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm
selftest/knownfail.d/ndr [deleted file]