fix crash bug in pidl generated client code, this
authorStefan Metzmacher <metze@samba.org>
Wed, 17 Oct 2007 08:35:51 +0000 (10:35 +0200)
committerStefan Metzmacher <metze@samba.org>
Wed, 17 Oct 2007 08:35:51 +0000 (10:35 +0200)
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

source/librpc/gen_ndr/cli_dfs.c
source/librpc/gen_ndr/cli_lsa.c
source/librpc/gen_ndr/cli_netlogon.c
source/librpc/gen_ndr/cli_srvsvc.c
source/librpc/gen_ndr/cli_svcctl.c
source/librpc/gen_ndr/cli_winreg.c
source/librpc/gen_ndr/cli_wkssvc.c

index 9a4e4c8d90c4ae4a499cfeab77cbd196fcfcbcde..154ceff067342e11a0b291ff9e9cac6081f72632 100644 (file)
@@ -198,10 +198,10 @@ NTSTATUS rpccli_dfs_Enum(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, uint3
        }
        
        /* Return variables */
-       if ( info ) {
+       if (info && r.out.info) {
                *info = *r.out.info;
        }
-       if ( total ) {
+       if (total && r.out.total) {
                *total = *r.out.total;
        }
        
@@ -358,7 +358,7 @@ NTSTATUS rpccli_dfs_AddFtRoot(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
        }
        
        /* Return variables */
-       if ( unknown2 ) {
+       if (unknown2 && r.out.unknown2) {
                *unknown2 = *r.out.unknown2;
        }
        
@@ -396,7 +396,7 @@ NTSTATUS rpccli_dfs_RemoveFtRoot(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ct
        }
        
        /* Return variables */
-       if ( unknown ) {
+       if (unknown && r.out.unknown) {
                *unknown = *r.out.unknown;
        }
        
@@ -709,10 +709,10 @@ NTSTATUS rpccli_dfs_EnumEx(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx, con
        }
        
        /* Return variables */
-       if ( info ) {
+       if (info && r.out.info) {
                *info = *r.out.info;
        }
-       if ( total ) {
+       if (total && r.out.total) {
                *total = *r.out.total;
        }
        
index 4c923582f985fb697978efe19dc7290fdaf836f6..50186360f67038b430ba525211bf14c92738f251 100644 (file)
@@ -127,7 +127,7 @@ NTSTATUS rpccli_lsa_QuerySecurity(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c
        }
        
        /* Return variables */
-       if ( sdbuf ) {
+       if (sdbuf && r.out.sdbuf) {
                *sdbuf = *r.out.sdbuf;
        }
        
@@ -252,7 +252,7 @@ NTSTATUS rpccli_lsa_QueryInfoPolicy(struct rpc_pipe_client *cli, TALLOC_CTX *mem
        }
        
        /* Return variables */
-       if ( info ) {
+       if (info && r.out.info) {
                *info = *r.out.info;
        }
        
@@ -482,7 +482,7 @@ NTSTATUS rpccli_lsa_LookupNames(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx
        }
        
        /* Return variables */
-       if ( domains ) {
+       if (domains && r.out.domains) {
                *domains = *r.out.domains;
        }
        *sids = *r.out.sids;
@@ -521,7 +521,7 @@ NTSTATUS rpccli_lsa_LookupSids(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
        }
        
        /* Return variables */
-       if ( domains ) {
+       if (domains && r.out.domains) {
                *domains = *r.out.domains;
        }
        *names = *r.out.names;
@@ -622,7 +622,7 @@ NTSTATUS rpccli_lsa_EnumPrivsAccount(struct rpc_pipe_client *cli, TALLOC_CTX *me
        }
        
        /* Return variables */
-       if ( privs ) {
+       if (privs && r.out.privs) {
                *privs = *r.out.privs;
        }
        
@@ -868,7 +868,7 @@ NTSTATUS rpccli_lsa_QueryTrustedDomainInfo(struct rpc_pipe_client *cli, TALLOC_C
        }
        
        /* Return variables */
-       if ( info ) {
+       if (info && r.out.info) {
                *info = *r.out.info;
        }
        
@@ -999,16 +999,16 @@ NTSTATUS rpccli_lsa_QuerySecret(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx
        }
        
        /* Return variables */
-       if ( new_val ) {
+       if (new_val && r.out.new_val) {
                *new_val = *r.out.new_val;
        }
-       if ( new_mtime ) {
+       if (new_mtime && r.out.new_mtime) {
                *new_mtime = *r.out.new_mtime;
        }
-       if ( old_val ) {
+       if (old_val && r.out.old_val) {
                *old_val = *r.out.old_val;
        }
-       if ( old_mtime ) {
+       if (old_mtime && r.out.old_mtime) {
                *old_mtime = *r.out.old_mtime;
        }
        
@@ -1074,7 +1074,7 @@ NTSTATUS rpccli_lsa_LookupPrivName(struct rpc_pipe_client *cli, TALLOC_CTX *mem_
        }
        
        /* Return variables */
-       if ( name ) {
+       if (name && r.out.name) {
                *name = *r.out.name;
        }
        
@@ -1110,7 +1110,7 @@ NTSTATUS rpccli_lsa_LookupPrivDisplayName(struct rpc_pipe_client *cli, TALLOC_CT
        }
        
        /* Return variables */
-       if ( disp_name ) {
+       if (disp_name && r.out.disp_name) {
                *disp_name = *r.out.disp_name;
        }
        *language_id = *r.out.language_id;
@@ -1304,7 +1304,7 @@ NTSTATUS rpccli_lsa_QueryTrustedDomainInfoBySid(struct rpc_pipe_client *cli, TAL
        }
        
        /* Return variables */
-       if ( info ) {
+       if (info && r.out.info) {
                *info = *r.out.info;
        }
        
@@ -1490,10 +1490,10 @@ NTSTATUS rpccli_lsa_GetUserName(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx
        }
        
        /* Return variables */
-       if ( account_name ) {
+       if (account_name && r.out.account_name) {
                *account_name = *r.out.account_name;
        }
-       if ( authority_name ) {
+       if (authority_name && r.out.authority_name) {
                *authority_name = *r.out.authority_name;
        }
        
@@ -1527,7 +1527,7 @@ NTSTATUS rpccli_lsa_QueryInfoPolicy2(struct rpc_pipe_client *cli, TALLOC_CTX *me
        }
        
        /* Return variables */
-       if ( info ) {
+       if (info && r.out.info) {
                *info = *r.out.info;
        }
        
@@ -1591,7 +1591,7 @@ NTSTATUS rpccli_lsa_QueryTrustedDomainInfoByName(struct rpc_pipe_client *cli, TA
        }
        
        /* Return variables */
-       if ( info ) {
+       if (info && r.out.info) {
                *info = *r.out.info;
        }
        
@@ -1752,7 +1752,7 @@ NTSTATUS rpccli_lsa_QueryDomainInformationPolicy(struct rpc_pipe_client *cli, TA
        }
        
        /* Return variables */
-       if ( info ) {
+       if (info && r.out.info) {
                *info = *r.out.info;
        }
        
@@ -1885,7 +1885,7 @@ NTSTATUS rpccli_lsa_LookupSids2(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx
        }
        
        /* Return variables */
-       if ( domains ) {
+       if (domains && r.out.domains) {
                *domains = *r.out.domains;
        }
        *names = *r.out.names;
@@ -1927,7 +1927,7 @@ NTSTATUS rpccli_lsa_LookupNames2(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ct
        }
        
        /* Return variables */
-       if ( domains ) {
+       if (domains && r.out.domains) {
                *domains = *r.out.domains;
        }
        *sids = *r.out.sids;
@@ -2230,7 +2230,7 @@ NTSTATUS rpccli_lsa_LookupNames3(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ct
        }
        
        /* Return variables */
-       if ( domains ) {
+       if (domains && r.out.domains) {
                *domains = *r.out.domains;
        }
        *sids = *r.out.sids;
@@ -2473,7 +2473,7 @@ NTSTATUS rpccli_lsa_LookupSids3(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx
        }
        
        /* Return variables */
-       if ( domains ) {
+       if (domains && r.out.domains) {
                *domains = *r.out.domains;
        }
        *names = *r.out.names;
@@ -2514,7 +2514,7 @@ NTSTATUS rpccli_lsa_LookupNames4(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ct
        }
        
        /* Return variables */
-       if ( domains ) {
+       if (domains && r.out.domains) {
                *domains = *r.out.domains;
        }
        *sids = *r.out.sids;
index d986cef58b4458e1485e9554833275f0261efdd4..20c5f2d2e5294d9e9aad1e526ef422d8d031dc01 100644 (file)
@@ -33,7 +33,7 @@ NTSTATUS rpccli_netr_LogonUasLogon(struct rpc_pipe_client *cli, TALLOC_CTX *mem_
        }
        
        /* Return variables */
-       if ( info ) {
+       if (info && r.out.info) {
                *info = *r.out.info;
        }
        
@@ -105,7 +105,7 @@ NTSTATUS rpccli_netr_LogonSamLogon(struct rpc_pipe_client *cli, TALLOC_CTX *mem_
        }
        
        /* Return variables */
-       if ( return_authenticator ) {
+       if (return_authenticator && r.out.return_authenticator) {
                *return_authenticator = *r.out.return_authenticator;
        }
        *validation = *r.out.validation;
@@ -145,7 +145,7 @@ NTSTATUS rpccli_netr_LogonSamLogoff(struct rpc_pipe_client *cli, TALLOC_CTX *mem
        }
        
        /* Return variables */
-       if ( return_authenticator ) {
+       if (return_authenticator && r.out.return_authenticator) {
                *return_authenticator = *r.out.return_authenticator;
        }
        
@@ -290,7 +290,7 @@ NTSTATUS rpccli_netr_DatabaseDeltas(struct rpc_pipe_client *cli, TALLOC_CTX *mem
        /* Return variables */
        *return_authenticator = *r.out.return_authenticator;
        *sequence_num = *r.out.sequence_num;
-       if ( delta_enum_array ) {
+       if (delta_enum_array && r.out.delta_enum_array) {
                *delta_enum_array = *r.out.delta_enum_array;
        }
        
@@ -331,7 +331,7 @@ NTSTATUS rpccli_netr_DatabaseSync(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c
        /* Return variables */
        *return_authenticator = *r.out.return_authenticator;
        *sync_context = *r.out.sync_context;
-       if ( delta_enum_array ) {
+       if (delta_enum_array && r.out.delta_enum_array) {
                *delta_enum_array = *r.out.delta_enum_array;
        }
        
@@ -626,7 +626,7 @@ NTSTATUS rpccli_netr_DatabaseSync2(struct rpc_pipe_client *cli, TALLOC_CTX *mem_
        /* Return variables */
        *return_authenticator = *r.out.return_authenticator;
        *sync_context = *r.out.sync_context;
-       if ( delta_enum_array ) {
+       if (delta_enum_array && r.out.delta_enum_array) {
                *delta_enum_array = *r.out.delta_enum_array;
        }
        
@@ -665,7 +665,7 @@ NTSTATUS rpccli_netr_DatabaseRedo(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c
        
        /* Return variables */
        *return_authenticator = *r.out.return_authenticator;
-       if ( delta_enum_array ) {
+       if (delta_enum_array && r.out.delta_enum_array) {
                *delta_enum_array = *r.out.delta_enum_array;
        }
        
@@ -765,7 +765,7 @@ NTSTATUS rpccli_netr_DsRGetDCName(struct rpc_pipe_client *cli, TALLOC_CTX *mem_c
        }
        
        /* Return variables */
-       if ( info ) {
+       if (info && r.out.info) {
                *info = *r.out.info;
        }
        
@@ -985,7 +985,7 @@ NTSTATUS rpccli_netr_DsRGetDCNameEx(struct rpc_pipe_client *cli, TALLOC_CTX *mem
        }
        
        /* Return variables */
-       if ( info ) {
+       if (info && r.out.info) {
                *info = *r.out.info;
        }
        
@@ -1215,7 +1215,7 @@ NTSTATUS rpccli_netr_DsRGetDCNameEx2(struct rpc_pipe_client *cli, TALLOC_CTX *me
        }
        
        /* Return variables */
-       if ( info ) {
+       if (info && r.out.info) {
                *info = *r.out.info;
        }
        
@@ -1558,7 +1558,7 @@ NTSTATUS rpccli_netr_LogonSamLogonWithFlags(struct rpc_pipe_client *cli, TALLOC_
        }
        
        /* Return variables */
-       if ( return_authenticator ) {
+       if (return_authenticator && r.out.return_authenticator) {
                *return_authenticator = *r.out.return_authenticator;
        }
        *validation = *r.out.validation;
index 7944340e47dc566c12504d8a603612f156a8c861..e848e5b9c14a4bec75bcb577379155d99bb6a0fc 100644 (file)
@@ -38,7 +38,7 @@ NTSTATUS rpccli_srvsvc_NetCharDevEnum(struct rpc_pipe_client *cli, TALLOC_CTX *m
        *level = *r.out.level;
        *ctr = *r.out.ctr;
        *totalentries = *r.out.totalentries;
-       if ( resume_handle ) {
+       if (resume_handle && r.out.resume_handle) {
                *resume_handle = *r.out.resume_handle;
        }
        
@@ -144,7 +144,7 @@ NTSTATUS rpccli_srvsvc_NetCharDevQEnum(struct rpc_pipe_client *cli, TALLOC_CTX *
        *level = *r.out.level;
        *ctr = *r.out.ctr;
        *totalentries = *r.out.totalentries;
-       if ( resume_handle ) {
+       if (resume_handle && r.out.resume_handle) {
                *resume_handle = *r.out.resume_handle;
        }
        
@@ -215,7 +215,7 @@ NTSTATUS rpccli_srvsvc_NetCharDevQSetInfo(struct rpc_pipe_client *cli, TALLOC_CT
        }
        
        /* Return variables */
-       if ( parm_error ) {
+       if (parm_error && r.out.parm_error) {
                *parm_error = *r.out.parm_error;
        }
        
@@ -319,7 +319,7 @@ NTSTATUS rpccli_srvsvc_NetConnEnum(struct rpc_pipe_client *cli, TALLOC_CTX *mem_
        *level = *r.out.level;
        *ctr = *r.out.ctr;
        *totalentries = *r.out.totalentries;
-       if ( resume_handle ) {
+       if (resume_handle && r.out.resume_handle) {
                *resume_handle = *r.out.resume_handle;
        }
        
@@ -361,7 +361,7 @@ NTSTATUS rpccli_srvsvc_NetFileEnum(struct rpc_pipe_client *cli, TALLOC_CTX *mem_
        *level = *r.out.level;
        *ctr = *r.out.ctr;
        *totalentries = *r.out.totalentries;
-       if ( resume_handle ) {
+       if (resume_handle && r.out.resume_handle) {
                *resume_handle = *r.out.resume_handle;
        }
        
@@ -467,7 +467,7 @@ NTSTATUS rpccli_srvsvc_NetSessEnum(struct rpc_pipe_client *cli, TALLOC_CTX *mem_
        *level = *r.out.level;
        *ctr = *r.out.ctr;
        *totalentries = *r.out.totalentries;
-       if ( resume_handle ) {
+       if (resume_handle && r.out.resume_handle) {
                *resume_handle = *r.out.resume_handle;
        }
        
@@ -535,7 +535,7 @@ NTSTATUS rpccli_srvsvc_NetShareAdd(struct rpc_pipe_client *cli, TALLOC_CTX *mem_
        }
        
        /* Return variables */
-       if ( parm_error ) {
+       if (parm_error && r.out.parm_error) {
                *parm_error = *r.out.parm_error;
        }
        
@@ -575,7 +575,7 @@ NTSTATUS rpccli_srvsvc_NetShareEnumAll(struct rpc_pipe_client *cli, TALLOC_CTX *
        *level = *r.out.level;
        *ctr = *r.out.ctr;
        *totalentries = *r.out.totalentries;
-       if ( resume_handle ) {
+       if (resume_handle && r.out.resume_handle) {
                *resume_handle = *r.out.resume_handle;
        }
        
@@ -645,7 +645,7 @@ NTSTATUS rpccli_srvsvc_NetShareSetInfo(struct rpc_pipe_client *cli, TALLOC_CTX *
        }
        
        /* Return variables */
-       if ( parm_error ) {
+       if (parm_error && r.out.parm_error) {
                *parm_error = *r.out.parm_error;
        }
        
@@ -809,7 +809,7 @@ NTSTATUS rpccli_srvsvc_NetSrvSetInfo(struct rpc_pipe_client *cli, TALLOC_CTX *me
        }
        
        /* Return variables */
-       if ( parm_error ) {
+       if (parm_error && r.out.parm_error) {
                *parm_error = *r.out.parm_error;
        }
        
@@ -848,7 +848,7 @@ NTSTATUS rpccli_srvsvc_NetDiskEnum(struct rpc_pipe_client *cli, TALLOC_CTX *mem_
        /* Return variables */
        *info = *r.out.info;
        *totalentries = *r.out.totalentries;
-       if ( resume_handle ) {
+       if (resume_handle && r.out.resume_handle) {
                *resume_handle = *r.out.resume_handle;
        }
        
@@ -954,7 +954,7 @@ NTSTATUS rpccli_srvsvc_NetTransportEnum(struct rpc_pipe_client *cli, TALLOC_CTX
        *level = *r.out.level;
        *transports = *r.out.transports;
        *totalentries = *r.out.totalentries;
-       if ( resume_handle ) {
+       if (resume_handle && r.out.resume_handle) {
                *resume_handle = *r.out.resume_handle;
        }
        
@@ -1019,7 +1019,7 @@ NTSTATUS rpccli_srvsvc_NetRemoteTOD(struct rpc_pipe_client *cli, TALLOC_CTX *mem
        }
        
        /* Return variables */
-       if ( info ) {
+       if (info && r.out.info) {
                *info = *r.out.info;
        }
        
@@ -1292,7 +1292,7 @@ NTSTATUS rpccli_srvsvc_NetShareEnum(struct rpc_pipe_client *cli, TALLOC_CTX *mem
        *level = *r.out.level;
        *ctr = *r.out.ctr;
        *totalentries = *r.out.totalentries;
-       if ( resume_handle ) {
+       if (resume_handle && r.out.resume_handle) {
                *resume_handle = *r.out.resume_handle;
        }
        
@@ -1327,7 +1327,7 @@ NTSTATUS rpccli_srvsvc_NetShareDelStart(struct rpc_pipe_client *cli, TALLOC_CTX
        }
        
        /* Return variables */
-       if ( hnd ) {
+       if (hnd && r.out.hnd) {
                *hnd = *r.out.hnd;
        }
        
@@ -1360,7 +1360,7 @@ NTSTATUS rpccli_srvsvc_NetShareDelCommit(struct rpc_pipe_client *cli, TALLOC_CTX
        }
        
        /* Return variables */
-       if ( hnd ) {
+       if (hnd && r.out.hnd) {
                *hnd = *r.out.hnd;
        }
        
@@ -1396,7 +1396,7 @@ NTSTATUS rpccli_srvsvc_NetGetFileSecurity(struct rpc_pipe_client *cli, TALLOC_CT
        }
        
        /* Return variables */
-       if ( sd_buf ) {
+       if (sd_buf && r.out.sd_buf) {
                *sd_buf = *r.out.sd_buf;
        }
        
index 91a1d3493b6275d9242b862310e3387de152bbfa..005ec85ad68945aef27978c82fb540b452ad0cc3 100644 (file)
@@ -420,7 +420,7 @@ NTSTATUS rpccli_svcctl_CreateServiceW(struct rpc_pipe_client *cli, TALLOC_CTX *m
        }
        
        /* Return variables */
-       if ( TagId ) {
+       if (TagId && r.out.TagId) {
                *TagId = *r.out.TagId;
        }
        *handle = *r.out.handle;
@@ -456,7 +456,7 @@ NTSTATUS rpccli_svcctl_EnumDependentServicesW(struct rpc_pipe_client *cli, TALLO
        }
        
        /* Return variables */
-       if ( service_status ) {
+       if (service_status && r.out.service_status) {
                *service_status = *r.out.service_status;
        }
        *bytes_needed = *r.out.bytes_needed;
@@ -498,7 +498,7 @@ NTSTATUS rpccli_svcctl_EnumServicesStatusW(struct rpc_pipe_client *cli, TALLOC_C
        memcpy(service, r.out.service, r.in.buf_size);
        *bytes_needed = *r.out.bytes_needed;
        *services_returned = *r.out.services_returned;
-       if ( resume_handle ) {
+       if (resume_handle && r.out.resume_handle) {
                *resume_handle = *r.out.resume_handle;
        }
        
@@ -698,7 +698,7 @@ NTSTATUS rpccli_svcctl_GetServiceDisplayNameW(struct rpc_pipe_client *cli, TALLO
        
        /* Return variables */
        *display_name = *r.out.display_name;
-       if ( display_name_length ) {
+       if (display_name_length && r.out.display_name_length) {
                *display_name_length = *r.out.display_name_length;
        }
        
@@ -734,7 +734,7 @@ NTSTATUS rpccli_svcctl_GetServiceKeyNameW(struct rpc_pipe_client *cli, TALLOC_CT
        
        /* Return variables */
        *key_name = *r.out.key_name;
-       if ( display_name_length ) {
+       if (display_name_length && r.out.display_name_length) {
                *display_name_length = *r.out.display_name_length;
        }
        
@@ -851,7 +851,7 @@ NTSTATUS rpccli_svcctl_CreateServiceA(struct rpc_pipe_client *cli, TALLOC_CTX *m
        }
        
        /* Return variables */
-       if ( TagId ) {
+       if (TagId && r.out.TagId) {
                *TagId = *r.out.TagId;
        }
        
@@ -886,7 +886,7 @@ NTSTATUS rpccli_svcctl_EnumDependentServicesA(struct rpc_pipe_client *cli, TALLO
        }
        
        /* Return variables */
-       if ( service_status ) {
+       if (service_status && r.out.service_status) {
                *service_status = *r.out.service_status;
        }
        *bytes_needed = *r.out.bytes_needed;
@@ -928,7 +928,7 @@ NTSTATUS rpccli_svcctl_EnumServicesStatusA(struct rpc_pipe_client *cli, TALLOC_C
        memcpy(service, r.out.service, r.in.buf_size);
        *bytes_needed = *r.out.bytes_needed;
        *services_returned = *r.out.services_returned;
-       if ( resume_handle ) {
+       if (resume_handle && r.out.resume_handle) {
                *resume_handle = *r.out.resume_handle;
        }
        
@@ -1127,7 +1127,7 @@ NTSTATUS rpccli_svcctl_GetServiceDisplayNameA(struct rpc_pipe_client *cli, TALLO
        
        /* Return variables */
        *display_name = *r.out.display_name;
-       if ( display_name_length ) {
+       if (display_name_length && r.out.display_name_length) {
                *display_name_length = *r.out.display_name_length;
        }
        
@@ -1163,7 +1163,7 @@ NTSTATUS rpccli_svcctl_GetServiceKeyNameA(struct rpc_pipe_client *cli, TALLOC_CT
        
        /* Return variables */
        *key_name = *r.out.key_name;
-       if ( display_name_length ) {
+       if (display_name_length && r.out.display_name_length) {
                *display_name_length = *r.out.display_name_length;
        }
        
@@ -1428,7 +1428,7 @@ NTSTATUS rpccli_EnumServicesStatusExA(struct rpc_pipe_client *cli, TALLOC_CTX *m
        memcpy(services, r.out.services, r.in.buf_size);
        *bytes_needed = *r.out.bytes_needed;
        *service_returned = *r.out.service_returned;
-       if ( resume_handle ) {
+       if (resume_handle && r.out.resume_handle) {
                *resume_handle = *r.out.resume_handle;
        }
        *group_name = *r.out.group_name;
@@ -1470,7 +1470,7 @@ NTSTATUS rpccli_EnumServicesStatusExW(struct rpc_pipe_client *cli, TALLOC_CTX *m
        memcpy(services, r.out.services, r.in.buf_size);
        *bytes_needed = *r.out.bytes_needed;
        *service_returned = *r.out.service_returned;
-       if ( resume_handle ) {
+       if (resume_handle && r.out.resume_handle) {
                *resume_handle = *r.out.resume_handle;
        }
        *group_name = *r.out.group_name;
index 8d45b4617c4e9b0a6792876dfb4b3b619a80478b..0450f056d055353eb01cdf3d8d9ce2ea838815e8 100644 (file)
@@ -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;
index ed65acce28f72951dc8bbbd059f5d856df3142cb..16b11277a2103d6267fea9926de68f5f642cc91b 100644 (file)
@@ -102,10 +102,10 @@ NTSTATUS rpccli_wkssvc_NetWkstaEnumUsers(struct rpc_pipe_client *cli, TALLOC_CTX
        
        /* Return variables */
        *users = *r.out.users;
-       if ( entriesread ) {
+       if (entriesread && r.out.entriesread) {
                *entriesread = *r.out.entriesread;
        }
-       if ( totalentries ) {
+       if (totalentries && r.out.totalentries) {
                *totalentries = *r.out.totalentries;
        }
        *resumehandle = *r.out.resumehandle;
@@ -203,7 +203,7 @@ NTSTATUS rpccli_wkssvc_NetWkstaTransportEnum(struct rpc_pipe_client *cli, TALLOC
        /* Return variables */
        *level = *r.out.level;
        *ctr = *r.out.ctr;
-       if ( totalentries ) {
+       if (totalentries && r.out.totalentries) {
                *totalentries = *r.out.totalentries;
        }
        *resume_handle = *r.out.resume_handle;