pidl: Generate and consume the switch level token for both NDR_SCALARS and NDR_BUFFER...
authorAndrew Bartlett <abartlet@samba.org>
Fri, 15 Nov 2019 03:59:12 +0000 (16:59 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 12 Dec 2019 02:30:40 +0000 (02:30 +0000)
commit603f23b19c90d6a1be4ac50e5984e6f9c8a63ba2
tree6da0bd5a161929a5b70511e0588510399aec2453
parentf7bcf227f7bac1817ecabbe3dccaebdd9a81a2f9
pidl: Generate and consume the switch level token for both NDR_SCALARS and NDR_BUFFERS in ndr_pull()

This means what was previously a list becomes a single variable that
could be passed as a function paraemter, but this is avoided for now
because it would change the ABI and be more intrusive.

Before this, a client could cause a NDR token containing the swith level
to be allocated for each and every element in the array that they
promised they were sending (without having to actually send them).

Found by Michael Hanselmann using Honggfuzz and an fuzzer for Samba's
NDR layer.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
pidl/lib/Parse/Pidl/Samba4/NDR/Parser.pm