summaryrefslogtreecommitdiffstats
path: root/source/rpc_server
diff options
context:
space:
mode:
authorMarc VanHeyningen <marc.vanheyningen@isilon.com>2008-03-14 14:26:28 -0800
committerKarolin Seeger <kseeger@samba.org>2008-03-18 12:10:55 +0100
commit4ec94fcd8d472338dd95e72d2a01a91de49b22e2 (patch)
treef5e90d4690df65619c0a8da4600e52b1e5e292b6 /source/rpc_server
parent4cc740bbdb64f34031c561a7ffeda98b9d741e85 (diff)
downloadsamba-4ec94fcd8d472338dd95e72d2a01a91de49b22e2.tar.gz
samba-4ec94fcd8d472338dd95e72d2a01a91de49b22e2.tar.xz
samba-4ec94fcd8d472338dd95e72d2a01a91de49b22e2.zip
Coverity fixes
(cherry picked from commit 3fc85d22590550f0539215d020e4411bf5b14363)
Diffstat (limited to 'source/rpc_server')
-rw-r--r--source/rpc_server/srv_pipe.c16
-rw-r--r--source/rpc_server/srv_pipe_hnd.c6
-rw-r--r--source/rpc_server/srv_spoolss_nt.c6
-rw-r--r--source/rpc_server/srv_winreg_nt.c6
4 files changed, 20 insertions, 14 deletions
diff --git a/source/rpc_server/srv_pipe.c b/source/rpc_server/srv_pipe.c
index 19c8db05335..6c1b65b858b 100644
--- a/source/rpc_server/srv_pipe.c
+++ b/source/rpc_server/srv_pipe.c
@@ -151,7 +151,7 @@ static bool create_next_pdu_ntlmssp(pipes_struct *p)
* data.
*/
- prs_init( &outgoing_pdu, 0, p->mem_ctx, MARSHALL);
+ prs_init_empty( &outgoing_pdu, p->mem_ctx, MARSHALL);
prs_give_memory( &outgoing_pdu, (char *)p->out_data.current_pdu, sizeof(p->out_data.current_pdu), False);
/* Store the header in the data stream. */
@@ -358,7 +358,7 @@ static bool create_next_pdu_schannel(pipes_struct *p)
* data.
*/
- prs_init( &outgoing_pdu, 0, p->mem_ctx, MARSHALL);
+ prs_init_empty( &outgoing_pdu, p->mem_ctx, MARSHALL);
prs_give_memory( &outgoing_pdu, (char *)p->out_data.current_pdu, sizeof(p->out_data.current_pdu), False);
/* Store the header in the data stream. */
@@ -531,7 +531,7 @@ static bool create_next_pdu_noauth(pipes_struct *p)
* data.
*/
- prs_init( &outgoing_pdu, 0, p->mem_ctx, MARSHALL);
+ prs_init_empty( &outgoing_pdu, p->mem_ctx, MARSHALL);
prs_give_memory( &outgoing_pdu, (char *)p->out_data.current_pdu, sizeof(p->out_data.current_pdu), False);
/* Store the header in the data stream. */
@@ -812,7 +812,7 @@ static bool setup_bind_nak(pipes_struct *p)
* header and are never sending more than one PDU here.
*/
- prs_init( &outgoing_rpc, 0, p->mem_ctx, MARSHALL);
+ prs_init_empty( &outgoing_rpc, p->mem_ctx, MARSHALL);
prs_give_memory( &outgoing_rpc, (char *)p->out_data.current_pdu, sizeof(p->out_data.current_pdu), False);
/*
@@ -875,7 +875,7 @@ bool setup_fault_pdu(pipes_struct *p, NTSTATUS status)
* header and are never sending more than one PDU here.
*/
- prs_init( &outgoing_pdu, 0, p->mem_ctx, MARSHALL);
+ prs_init_empty( &outgoing_pdu, p->mem_ctx, MARSHALL);
prs_give_memory( &outgoing_pdu, (char *)p->out_data.current_pdu, sizeof(p->out_data.current_pdu), False);
/*
@@ -944,7 +944,7 @@ bool setup_cancel_ack_reply(pipes_struct *p, prs_struct *rpc_in_p)
* header and are never sending more than one PDU here.
*/
- prs_init( &outgoing_pdu, 0, p->mem_ctx, MARSHALL);
+ prs_init_empty( &outgoing_pdu, p->mem_ctx, MARSHALL);
prs_give_memory( &outgoing_pdu, (char *)p->out_data.current_pdu, sizeof(p->out_data.current_pdu), False);
/*
@@ -1522,7 +1522,7 @@ bool api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p)
return setup_bind_nak(p);
}
- prs_init( &outgoing_rpc, 0, p->mem_ctx, MARSHALL);
+ prs_init_empty( &outgoing_rpc, p->mem_ctx, MARSHALL);
/*
* Marshall directly into the outgoing PDU space. We
@@ -1794,7 +1794,7 @@ bool api_pipe_alter_context(pipes_struct *p, prs_struct *rpc_in_p)
prs_struct outgoing_rpc;
int auth_len = 0;
- prs_init( &outgoing_rpc, 0, p->mem_ctx, MARSHALL);
+ prs_init_empty( &outgoing_rpc, p->mem_ctx, MARSHALL);
/*
* Marshall directly into the outgoing PDU space. We
diff --git a/source/rpc_server/srv_pipe_hnd.c b/source/rpc_server/srv_pipe_hnd.c
index 95ce496ba60..45f649d0cea 100644
--- a/source/rpc_server/srv_pipe_hnd.c
+++ b/source/rpc_server/srv_pipe_hnd.c
@@ -348,7 +348,7 @@ static void *make_internal_rpc_pipe_p(const char *pipe_name,
/*
* Initialize the outgoing RPC data buffer with no memory.
*/
- prs_init(&p->out_data.rdata, 0, p->mem_ctx, MARSHALL);
+ prs_init_empty(&p->out_data.rdata, p->mem_ctx, MARSHALL);
fstrcpy(p->name, pipe_name);
@@ -408,7 +408,7 @@ static ssize_t unmarshall_rpc_header(pipes_struct *p)
return -1;
}
- prs_init( &rpc_in, 0, p->mem_ctx, UNMARSHALL);
+ prs_init_empty( &rpc_in, p->mem_ctx, UNMARSHALL);
prs_set_endian_data( &rpc_in, p->endian);
prs_give_memory( &rpc_in, (char *)&p->in_data.current_in_pdu[0],
@@ -693,7 +693,7 @@ static void process_complete_pdu(pipes_struct *p)
return;
}
- prs_init( &rpc_in, 0, p->mem_ctx, UNMARSHALL);
+ prs_init_empty( &rpc_in, p->mem_ctx, UNMARSHALL);
/*
* Ensure we're using the corrent endianness for both the
diff --git a/source/rpc_server/srv_spoolss_nt.c b/source/rpc_server/srv_spoolss_nt.c
index 3758c8fd63e..403beb6782b 100644
--- a/source/rpc_server/srv_spoolss_nt.c
+++ b/source/rpc_server/srv_spoolss_nt.c
@@ -6033,7 +6033,11 @@ static WERROR update_printer_sec(POLICY_HND *handle, uint32 level,
/* NT seems to like setting the security descriptor even though
nothing may have actually changed. */
- nt_printing_getsec(p->mem_ctx, Printer->sharename, &old_secdesc_ctr);
+ if ( !nt_printing_getsec(p->mem_ctx, Printer->sharename, &old_secdesc_ctr)) {
+ DEBUG(2,("update_printer_sec: nt_printing_getsec() failed\n"));
+ result = WERR_BADFID;
+ goto done;
+ }
if (DEBUGLEVEL >= 10) {
SEC_ACL *the_acl;
diff --git a/source/rpc_server/srv_winreg_nt.c b/source/rpc_server/srv_winreg_nt.c
index 7ff93e0b07e..77c2513dfe2 100644
--- a/source/rpc_server/srv_winreg_nt.c
+++ b/source/rpc_server/srv_winreg_nt.c
@@ -239,7 +239,8 @@ WERROR _winreg_QueryValue(pipes_struct *p, struct winreg_QueryValue *r)
if(regkey->key->type == REG_KEY_HKPD)
{
if(strequal(r->in.value_name.name, "Global")) {
- prs_init(&prs_hkpd, *r->in.data_size, p->mem_ctx, MARSHALL);
+ if (!prs_init(&prs_hkpd, *r->in.data_size, p->mem_ctx, MARSHALL))
+ return WERR_NOMEM;
status = reg_perfcount_get_hkpd(
&prs_hkpd, *r->in.data_size, &outbuf_size, NULL);
outbuf = (uint8_t *)prs_hkpd.data_p;
@@ -260,7 +261,8 @@ WERROR _winreg_QueryValue(pipes_struct *p, struct winreg_QueryValue *r)
else if(isdigit(r->in.value_name.name[0])) {
/* we probably have a request for a specific object
* here */
- prs_init(&prs_hkpd, *r->in.data_size, p->mem_ctx, MARSHALL);
+ if (!prs_init(&prs_hkpd, *r->in.data_size, p->mem_ctx, MARSHALL))
+ return WERR_NOMEM;
status = reg_perfcount_get_hkpd(
&prs_hkpd, *r->in.data_size, &outbuf_size,
r->in.value_name.name);