summaryrefslogtreecommitdiff
path: root/source3/librpc/gen_ndr/cli_srvsvc.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-10-17 10:35:51 +0200
committerStefan Metzmacher <metze@samba.org>2007-10-17 10:35:51 +0200
commitba7a979e5374da422b0657161289e344dc23afa1 (patch)
tree3eb895df2ef02fb11dc032512c81b108b6320733 /source3/librpc/gen_ndr/cli_srvsvc.c
parent2b2168bff6ae50954334fa1e391e022e9986841d (diff)
downloadsamba-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_srvsvc.c')
-rw-r--r--source3/librpc/gen_ndr/cli_srvsvc.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/source3/librpc/gen_ndr/cli_srvsvc.c b/source3/librpc/gen_ndr/cli_srvsvc.c
index 7944340e47..e848e5b9c1 100644
--- a/source3/librpc/gen_ndr/cli_srvsvc.c
+++ b/source3/librpc/gen_ndr/cli_srvsvc.c
@@ -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;
}