summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/cli_spoolss.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/source3/rpc_client/cli_spoolss.c b/source3/rpc_client/cli_spoolss.c
index 75c617c944..2d40f5dba1 100644
--- a/source3/rpc_client/cli_spoolss.c
+++ b/source3/rpc_client/cli_spoolss.c
@@ -1609,7 +1609,11 @@ WERROR rpccli_spoolss_getprinterdata(struct rpc_pipe_client *cli, TALLOC_CTX *me
/* Return output parameters */
- value->data_p = (uint8 *)TALLOC_MEMDUP(mem_ctx, out.data, out.needed);
+ if (out.needed) {
+ value->data_p = (uint8 *)TALLOC_MEMDUP(mem_ctx, out.data, out.needed);
+ } else {
+ value->data_p = NULL;
+ }
value->type = out.type;
value->size = out.size;
@@ -1662,7 +1666,11 @@ WERROR rpccli_spoolss_getprinterdataex(struct rpc_pipe_client *cli, TALLOC_CTX *
/* Return output parameters */
- value->data_p = (uint8 *)TALLOC_MEMDUP(mem_ctx, out.data, out.needed);
+ if (out.needed) {
+ value->data_p = (uint8 *)TALLOC_MEMDUP(mem_ctx, out.data, out.needed);
+ } else {
+ value->data_p = NULL;
+ }
value->type = out.type;
value->size = out.needed;
@@ -1758,8 +1766,12 @@ WERROR rpccli_spoolss_enumprinterdata(struct rpc_pipe_client *cli, TALLOC_CTX *m
if (value) {
rpcstr_pull(value->valuename, out.value, sizeof(value->valuename), -1,
STR_TERMINATE);
- value->data_p = (uint8 *)TALLOC_MEMDUP(mem_ctx, out.data,
+ if (out.realdatasize) {
+ value->data_p = (uint8 *)TALLOC_MEMDUP(mem_ctx, out.data,
out.realdatasize);
+ } else {
+ value->data_p = NULL;
+ }
value->type = out.type;
value->size = out.realdatasize;
}