summaryrefslogtreecommitdiff
path: root/librpc/ndr
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-12-12 02:52:41 +0100
committerGünther Deschner <gd@samba.org>2009-12-14 10:39:34 +0100
commite316624ddb8d4e178b03b315bfafd793e6c297c8 (patch)
tree9ca063db63742640ae309741494df3f1c616b9d8 /librpc/ndr
parent5ae61cfbc281f346fd3712a975c5796f9cfbc6c2 (diff)
downloadsamba-e316624ddb8d4e178b03b315bfafd793e6c297c8.tar.gz
samba-e316624ddb8d4e178b03b315bfafd793e6c297c8.tar.bz2
samba-e316624ddb8d4e178b03b315bfafd793e6c297c8.zip
spoolss: fix spoolss_PrinterData size calculation.
Currently we were crashing in EnumPrinterDataEx when an e.g. an empty (NULL) string for a separator file was returned. Guenther
Diffstat (limited to 'librpc/ndr')
-rw-r--r--librpc/ndr/ndr_spoolss_buf.c8
-rw-r--r--librpc/ndr/ndr_spoolss_buf.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/librpc/ndr/ndr_spoolss_buf.c b/librpc/ndr/ndr_spoolss_buf.c
index 853d9aaac6..b8d6f83ab6 100644
--- a/librpc/ndr/ndr_spoolss_buf.c
+++ b/librpc/ndr/ndr_spoolss_buf.c
@@ -1355,3 +1355,11 @@ void ndr_print_spoolss_Field(struct ndr_print *ndr, const char *name, const unio
}
}
+_PUBLIC_ size_t ndr_size_spoolss_PrinterData(const union spoolss_PrinterData *r, uint32_t level, struct smb_iconv_convenience *ic, int flags)
+{
+ if (!r) {
+ return 0;
+ }
+ return ndr_size_union(r, flags, level, (ndr_push_flags_fn_t)ndr_push_spoolss_PrinterData, ic);
+}
+
diff --git a/librpc/ndr/ndr_spoolss_buf.h b/librpc/ndr/ndr_spoolss_buf.h
index c0c553b241..a53ab7bb8c 100644
--- a/librpc/ndr/ndr_spoolss_buf.h
+++ b/librpc/ndr/ndr_spoolss_buf.h
@@ -53,6 +53,7 @@ size_t ndr_size_spoolss_StringArray(const struct spoolss_StringArray *r, struct
_PUBLIC_ enum ndr_err_code ndr_push_spoolss_DriverInfo101(struct ndr_push *ndr, int ndr_flags, const struct spoolss_DriverInfo101 *r);
_PUBLIC_ enum ndr_err_code ndr_pull_spoolss_DriverInfo101(struct ndr_pull *ndr, int ndr_flags, struct spoolss_DriverInfo101 *r);
void ndr_print_spoolss_Field(struct ndr_print *ndr, const char *name, const union spoolss_Field *r);
+size_t ndr_size_spoolss_PrinterData(const union spoolss_PrinterData *r, uint32_t level, struct smb_iconv_convenience *ic, int flags);
#undef _PRINTF_ATTRIBUTE
#define _PRINTF_ATTRIBUTE(a1, a2)