summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2010-08-02 13:49:59 +0200
committerAndreas Schneider <asn@samba.org>2010-08-02 16:42:39 +0200
commitd3fff4590420a3b2d1858e6c8dbaf4df93447a46 (patch)
tree275f43367ee988328e86e18e5356f4ba4b1d6918 /source3
parent307bd439d7f5df828923189c02fcbe30124d1e01 (diff)
downloadsamba-d3fff4590420a3b2d1858e6c8dbaf4df93447a46.tar.gz
samba-d3fff4590420a3b2d1858e6c8dbaf4df93447a46.tar.bz2
samba-d3fff4590420a3b2d1858e6c8dbaf4df93447a46.zip
s3-spoolss: Fixed a segfault if a value has no data.
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_server/srv_spoolss_util.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source3/rpc_server/srv_spoolss_util.c b/source3/rpc_server/srv_spoolss_util.c
index 60d282551f..3a9523c5aa 100644
--- a/source3/rpc_server/srv_spoolss_util.c
+++ b/source3/rpc_server/srv_spoolss_util.c
@@ -443,7 +443,7 @@ static WERROR winreg_printer_enumvalues(TALLOC_CTX *mem_ctx,
struct spoolss_PrinterEnumValues val;
struct winreg_ValNameBuf name_buf;
enum winreg_Type type = REG_NONE;
- uint8_t *data = NULL;
+ uint8_t *data;
uint32_t data_size;
uint32_t length;
char n = '\0';;
@@ -453,7 +453,10 @@ static WERROR winreg_printer_enumvalues(TALLOC_CTX *mem_ctx,
name_buf.length = 0;
data_size = max_valbufsize;
- data = (uint8_t *) TALLOC(tmp_ctx, data_size);
+ data = NULL;
+ if (data_size) {
+ data = (uint8_t *) TALLOC(tmp_ctx, data_size);
+ }
length = 0;
status = rpccli_winreg_EnumValue(pipe_handle,
@@ -463,7 +466,7 @@ static WERROR winreg_printer_enumvalues(TALLOC_CTX *mem_ctx,
&name_buf,
&type,
data,
- &data_size,
+ data_size ? &data_size : NULL,
&length,
&result);
if (W_ERROR_EQUAL(result, WERR_NO_MORE_ITEMS) ) {