diff options
author | Marc VanHeyningen <marc.vanheyningen@isilon.com> | 2008-03-14 14:26:28 -0800 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-03-17 20:52:25 +0100 |
commit | e06aa46b9fab1e107fea8f6453fb13deffa91e96 (patch) | |
tree | db972999f1b17db3e6b100fec70b5f4643632172 /source3/rpc_parse | |
parent | 6274929b1e1ddf89f4c5e93414121eaf06b6ab14 (diff) | |
download | samba-e06aa46b9fab1e107fea8f6453fb13deffa91e96.tar.gz samba-e06aa46b9fab1e107fea8f6453fb13deffa91e96.tar.bz2 samba-e06aa46b9fab1e107fea8f6453fb13deffa91e96.zip |
Coverity fixes
(This used to be commit 3fc85d22590550f0539215d020e4411bf5b14363)
Diffstat (limited to 'source3/rpc_parse')
-rw-r--r-- | source3/rpc_parse/parse_buffer.c | 6 | ||||
-rw-r--r-- | source3/rpc_parse/parse_misc.c | 27 | ||||
-rw-r--r-- | source3/rpc_parse/parse_prs.c | 2 |
3 files changed, 23 insertions, 12 deletions
diff --git a/source3/rpc_parse/parse_buffer.c b/source3/rpc_parse/parse_buffer.c index e98822d46e..9a68e547a0 100644 --- a/source3/rpc_parse/parse_buffer.c +++ b/source3/rpc_parse/parse_buffer.c @@ -34,8 +34,10 @@ void rpcbuf_init(RPC_BUFFER *buffer, uint32 size, TALLOC_CTX *ctx) { buffer->size = size; buffer->string_at_end = size; - prs_init(&buffer->prs, size, ctx, MARSHALL); - buffer->struct_start = prs_offset(&buffer->prs); + if (prs_init(&buffer->prs, size, ctx, MARSHALL)) + buffer->struct_start = prs_offset(&buffer->prs); + else + buffer->struct_start = NULL; } /******************************************************************* diff --git a/source3/rpc_parse/parse_misc.c b/source3/rpc_parse/parse_misc.c index 418f857df8..3850c440af 100644 --- a/source3/rpc_parse/parse_misc.c +++ b/source3/rpc_parse/parse_misc.c @@ -285,7 +285,8 @@ bool smb_io_strhdr(const char *desc, STRHDR *hdr, prs_struct *ps, int depth) prs_debug(ps, depth, desc, "smb_io_strhdr"); depth++; - prs_align(ps); + if(!prs_align(ps)) + return False; if(!prs_uint16("str_str_len", ps, depth, &hdr->str_str_len)) return False; @@ -1761,10 +1762,14 @@ bool smb_io_bufhdr2(const char *desc, BUFHDR2 *hdr, prs_struct *ps, int depth) prs_debug(ps, depth, desc, "smb_io_bufhdr2"); depth++; - prs_align(ps); - prs_uint32("info_level", ps, depth, &(hdr->info_level)); - prs_uint32("length ", ps, depth, &(hdr->length )); - prs_uint32("buffer ", ps, depth, &(hdr->buffer )); + if (!prs_align(ps)) + return False; + if (!prs_uint32("info_level", ps, depth, &(hdr->info_level))) + return False; + if (!prs_uint32("length ", ps, depth, &(hdr->length ))) + return False; + if (!prs_uint32("buffer ", ps, depth, &(hdr->buffer ))) + return False; return True; } @@ -1777,9 +1782,12 @@ bool smb_io_bufhdr4(const char *desc, BUFHDR4 *hdr, prs_struct *ps, int depth) prs_debug(ps, depth, desc, "smb_io_bufhdr4"); depth++; - prs_align(ps); - prs_uint32("size", ps, depth, &hdr->size); - prs_uint32("buffer", ps, depth, &hdr->buffer); + if (!prs_align(ps)) + return False; + if (!prs_uint32("size", ps, depth, &hdr->size)) + return False; + if (!prs_uint32("buffer", ps, depth, &hdr->buffer)) + return False; return True; } @@ -1793,7 +1801,8 @@ bool smb_io_rpc_blob(const char *desc, RPC_DATA_BLOB *blob, prs_struct *ps, int prs_debug(ps, depth, desc, "smb_io_rpc_blob"); depth++; - prs_align(ps); + if (!prs_align(ps)) + return False; if ( !prs_uint32("buf_len", ps, depth, &blob->buf_len) ) return False; diff --git a/source3/rpc_parse/parse_prs.c b/source3/rpc_parse/parse_prs.c index 638d71a73e..072132f5ac 100644 --- a/source3/rpc_parse/parse_prs.c +++ b/source3/rpc_parse/parse_prs.c @@ -1496,7 +1496,7 @@ int tdb_prs_fetch(TDB_CONTEXT *tdb, TDB_DATA kbuf, prs_struct *ps, TALLOC_CTX *m { TDB_DATA dbuf; - prs_init(ps, 0, mem_ctx, UNMARSHALL); + prs_init_empty(ps, mem_ctx, UNMARSHALL); dbuf = tdb_fetch(tdb, kbuf); if (!dbuf.dptr) |