summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2010-04-27 11:52:26 -0400
committerGünther Deschner <gd@samba.org>2010-05-05 18:17:13 +0200
commit24225bf032fb99e8949a741007cc6d199ee4702c (patch)
tree6cefd33617ce21a6cefbe32d7736eadb3a51126f
parent740418a150ff0ccccf47b4a40783c35f81723a89 (diff)
downloadsamba-24225bf032fb99e8949a741007cc6d199ee4702c.tar.gz
samba-24225bf032fb99e8949a741007cc6d199ee4702c.tar.bz2
samba-24225bf032fb99e8949a741007cc6d199ee4702c.zip
s3-spoolss: Fixed winreg_printer_query_XXX.
A cast to an incorrectly sized pointer was breaking on 64bit architectures where size_t is 64bit. Signed-off-by: Günther Deschner <gd@samba.org>
-rw-r--r--source3/rpc_server/srv_spoolss_util.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/source3/rpc_server/srv_spoolss_util.c b/source3/rpc_server/srv_spoolss_util.c
index 786aef176a..82882af2dc 100644
--- a/source3/rpc_server/srv_spoolss_util.c
+++ b/source3/rpc_server/srv_spoolss_util.c
@@ -1020,6 +1020,7 @@ static WERROR winreg_printer_query_binary(TALLOC_CTX *mem_ctx,
enum winreg_Type type;
WERROR result = WERR_OK;
uint32_t value_len = 0;
+ uint32_t data_size = 0;
NTSTATUS status;
DATA_BLOB blob;
@@ -1030,7 +1031,7 @@ static WERROR winreg_printer_query_binary(TALLOC_CTX *mem_ctx,
&wvalue,
&type,
NULL,
- (uint32_t *) &blob.length,
+ &data_size,
&value_len,
&result);
if (!NT_STATUS_IS_OK(status)) {
@@ -1047,8 +1048,7 @@ static WERROR winreg_printer_query_binary(TALLOC_CTX *mem_ctx,
result = WERR_INVALID_DATATYPE;
goto done;
}
-
- blob.data = (uint8_t *) TALLOC(mem_ctx, blob.length);
+ blob = data_blob_talloc(mem_ctx, NULL, data_size);
if (blob.data == NULL) {
result = WERR_NOMEM;
goto done;
@@ -1061,7 +1061,7 @@ static WERROR winreg_printer_query_binary(TALLOC_CTX *mem_ctx,
&wvalue,
&type,
blob.data,
- (uint32_t *) &blob.length,
+ &data_size,
&value_len,
&result);
if (!NT_STATUS_IS_OK(status)) {
@@ -1091,6 +1091,7 @@ static WERROR winreg_printer_query_dword(TALLOC_CTX *mem_ctx,
enum winreg_Type type;
WERROR result = WERR_OK;
uint32_t value_len = 0;
+ uint32_t data_size = 0;
NTSTATUS status;
DATA_BLOB blob;
@@ -1101,7 +1102,7 @@ static WERROR winreg_printer_query_dword(TALLOC_CTX *mem_ctx,
&wvalue,
&type,
NULL,
- (uint32_t *) &blob.length,
+ &data_size,
&value_len,
&result);
if (!NT_STATUS_IS_OK(status)) {
@@ -1119,12 +1120,12 @@ static WERROR winreg_printer_query_dword(TALLOC_CTX *mem_ctx,
goto done;
}
- if (blob.length != 4) {
+ if (data_size != 4) {
result = WERR_INVALID_DATA;
goto done;
}
- blob.data = (uint8_t *) TALLOC(mem_ctx, blob.length);
+ blob = data_blob_talloc(mem_ctx, NULL, data_size);
if (blob.data == NULL) {
result = WERR_NOMEM;
goto done;
@@ -1137,7 +1138,7 @@ static WERROR winreg_printer_query_dword(TALLOC_CTX *mem_ctx,
&wvalue,
&type,
blob.data,
- (uint32_t *) &blob.length,
+ &data_size,
&value_len,
&result);
if (!NT_STATUS_IS_OK(status)) {