summaryrefslogtreecommitdiff
path: root/source3/rpc_server/spoolss
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2013-01-16 01:15:49 +0100
committerDavid Disseldorp <ddiss@samba.org>2013-01-17 17:11:37 +0100
commit8304fe73f69ea7de57bd2d331038c4664553a9bd (patch)
treecad9cb9aa73651190673f499d9342a7f5212759a /source3/rpc_server/spoolss
parentbe8c81bfa3c6a2727eab589a71c6215ca76e3d3a (diff)
downloadsamba-8304fe73f69ea7de57bd2d331038c4664553a9bd.tar.gz
samba-8304fe73f69ea7de57bd2d331038c4664553a9bd.tar.bz2
samba-8304fe73f69ea7de57bd2d331038c4664553a9bd.zip
spoolss: make spoolss deal with ndr64 AddForm by using proper container object.
Guenther Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
Diffstat (limited to 'source3/rpc_server/spoolss')
-rw-r--r--source3/rpc_server/spoolss/srv_spoolss_nt.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c
index 48a2981986..b4f1bec15e 100644
--- a/source3/rpc_server/spoolss/srv_spoolss_nt.c
+++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c
@@ -8648,7 +8648,7 @@ WERROR _spoolss_DeletePrinterData(struct pipes_struct *p,
WERROR _spoolss_AddForm(struct pipes_struct *p,
struct spoolss_AddForm *r)
{
- struct spoolss_AddFormInfo1 *form = r->in.info.info1;
+ struct spoolss_AddFormInfo1 *form;
int snum = -1;
WERROR status = WERR_OK;
struct printer_handle *Printer = find_printer_index_by_hnd(p, r->in.handle);
@@ -8673,6 +8673,15 @@ WERROR _spoolss_AddForm(struct pipes_struct *p,
return WERR_ACCESS_DENIED;
}
+ if (r->in.info_ctr->level != 1) {
+ return WERR_INVALID_LEVEL;
+ }
+
+ form = r->in.info_ctr->info.info1;
+ if (!form) {
+ return WERR_INVALID_PARAM;
+ }
+
switch (form->flags) {
case SPOOLSS_FORM_USER:
case SPOOLSS_FORM_BUILTIN: