From d4135a3bdbe70bf87632396b79af5b17c7da5dd5 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 3 Feb 2007 00:50:47 +0000 Subject: r21129: Fix from Martin Zielinski - ensure the hand marshalled container size is a multiple of 4 bytes for RPC alignment. Jeremy. (This used to be commit 0e9ad2b29f1c05dc3f5d5e9659fe0557fa077d2e) --- source3/rpc_server/srv_spoolss_nt.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source3') diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index 3270801fc2..d0a754f281 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -9532,6 +9532,16 @@ WERROR _spoolss_enumprinterdataex(pipes_struct *p, SPOOL_Q_ENUMPRINTERDATAEX *q_ /* copy data into the reply */ r_u->ctr.size = r_u->needed; + + /* Fix from Martin Zielinski - ensure + * the hand marshalled container size is a multiple + * of 4 bytes for RPC alignment. + */ + + if (needed % 4) { + r_u->ctr.size += 4-(needed % 4); + } + r_u->ctr.size_of_array = r_u->returned; r_u->ctr.values = enum_values; -- cgit