From e06aa46b9fab1e107fea8f6453fb13deffa91e96 Mon Sep 17 00:00:00 2001 From: Marc VanHeyningen Date: Fri, 14 Mar 2008 14:26:28 -0800 Subject: Coverity fixes (This used to be commit 3fc85d22590550f0539215d020e4411bf5b14363) --- source3/registry/reg_backend_printing.c | 3 ++- source3/registry/regfio.c | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'source3/registry') diff --git a/source3/registry/reg_backend_printing.c b/source3/registry/reg_backend_printing.c index a4da103d40..582989d8d1 100644 --- a/source3/registry/reg_backend_printing.c +++ b/source3/registry/reg_backend_printing.c @@ -443,7 +443,8 @@ static void fill_in_printer_values( NT_PRINTER_INFO_LEVEL_2 *info2, REGVAL_CTR * /* use a prs_struct for converting the devmode and security descriptor to REG_BINARY */ - prs_init( &prs, RPC_MAX_PDU_FRAG_LEN, values, MARSHALL); + if (!prs_init( &prs, RPC_MAX_PDU_FRAG_LEN, values, MARSHALL)) + return; /* stream the device mode */ diff --git a/source3/registry/regfio.c b/source3/registry/regfio.c index 1c3aad7a25..9eb2c58298 100644 --- a/source3/registry/regfio.c +++ b/source3/registry/regfio.c @@ -123,7 +123,10 @@ static int read_block( REGF_FILE *file, prs_struct *ps, uint32 file_offset, uint return -1; } - prs_init( ps, block_size, file->mem_ctx, UNMARSHALL ); + if (!prs_init( ps, block_size, file->mem_ctx, UNMARSHALL )) { + DEBUG(0,("read_block: prs_init() failed! (%s)\n", strerror(errno) )); + return -1; + } buffer = prs_data_p( ps ); bytes_read = returned = 0; -- cgit