diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-10-17 10:35:51 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-10-17 10:35:51 +0200 |
commit | ba7a979e5374da422b0657161289e344dc23afa1 (patch) | |
tree | 3eb895df2ef02fb11dc032512c81b108b6320733 /source3/librpc/gen_ndr/cli_winreg.c | |
parent | 2b2168bff6ae50954334fa1e391e022e9986841d (diff) | |
download | samba-ba7a979e5374da422b0657161289e344dc23afa1.tar.gz samba-ba7a979e5374da422b0657161289e344dc23afa1.tar.bz2 samba-ba7a979e5374da422b0657161289e344dc23afa1.zip |
fix crash bug in pidl generated client code, this
could have happend with [in,out,unique] pointers
when the clients sends a valid pointer, but the server
reponse with a NULL pointer (as samba-3.0.26a do for some calls).
I've tested with midl to see how windows handles this situation
and also the reverse case where the client sends NULL and
the server reposnse with non-NULL.
It appears that midl generated code just ignores this
and only copies the result if both pointers are non-NULL.
metze
(This used to be commit cb98869fa189ce2a926a00fa9077a114f31a5d45)
Diffstat (limited to 'source3/librpc/gen_ndr/cli_winreg.c')
-rw-r--r-- | source3/librpc/gen_ndr/cli_winreg.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/source3/librpc/gen_ndr/cli_winreg.c b/source3/librpc/gen_ndr/cli_winreg.c index 8d45b4617c..0450f056d0 100644 --- a/source3/librpc/gen_ndr/cli_winreg.c +++ b/source3/librpc/gen_ndr/cli_winreg.c @@ -229,7 +229,7 @@ NTSTATUS rpccli_winreg_CreateKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ct /* Return variables */ *new_handle = *r.out.new_handle; - if ( action_taken ) { + if (action_taken && r.out.action_taken) { *action_taken = *r.out.action_taken; } @@ -329,10 +329,10 @@ NTSTATUS rpccli_winreg_EnumKey(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, /* Return variables */ *name = *r.out.name; - if ( keyclass ) { + if (keyclass && r.out.keyclass) { *keyclass = *r.out.keyclass; } - if ( last_changed_time ) { + if (last_changed_time && r.out.last_changed_time) { *last_changed_time = *r.out.last_changed_time; } @@ -372,16 +372,16 @@ NTSTATUS rpccli_winreg_EnumValue(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ct /* Return variables */ *name = *r.out.name; - if ( type ) { + if (type && r.out.type) { *type = *r.out.type; } - if ( value ) { + if (value && r.out.value) { memcpy(value, r.out.value, *r.in.size); } - if ( size ) { + if (size && r.out.size) { *size = *r.out.size; } - if ( length ) { + if (length && r.out.length) { *length = *r.out.length; } @@ -624,16 +624,16 @@ NTSTATUS rpccli_winreg_QueryValue(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c } /* Return variables */ - if ( type ) { + if (type && r.out.type) { *type = *r.out.type; } - if ( data ) { + if (data && r.out.data) { memcpy(data, r.out.data, *r.in.data_size); } - if ( data_size ) { + if (data_size && r.out.data_size) { *data_size = *r.out.data_size; } - if ( value_length ) { + if (value_length && r.out.value_length) { *value_length = *r.out.value_length; } @@ -1018,7 +1018,7 @@ NTSTATUS rpccli_winreg_QueryMultipleValues(struct rpc_pipe_client *cli, TALLOC_C /* Return variables */ memcpy(values, r.out.values, r.in.num_values); - if ( buffer ) { + if (buffer && r.out.buffer) { memcpy(buffer, r.out.buffer, *r.in.buffer_size); } *buffer_size = *r.out.buffer_size; |