From 23c766bbfde6e0ee72b221668a5e686f84e5a0ff Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Thu, 4 May 2006 22:07:35 +0000 Subject: [PATCH] make sure NULL pointers are not dereferenced --- servers/slapd/back-meta/bind.c | 2 ++ servers/slapd/back-meta/search.c | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/servers/slapd/back-meta/bind.c b/servers/slapd/back-meta/bind.c index cc8fea04b8..78ffc28ef6 100644 --- a/servers/slapd/back-meta/bind.c +++ b/servers/slapd/back-meta/bind.c @@ -840,6 +840,8 @@ meta_back_op_result( *save_rmatch = NULL; void *rmatch_ctx = NULL; + assert( mc != NULL ); + if ( candidate != META_TARGET_NONE ) { metasingleconn_t *msc = &mc->mc_conns[ candidate ]; diff --git a/servers/slapd/back-meta/search.c b/servers/slapd/back-meta/search.c index ef2a129912..9cb55ccd7a 100644 --- a/servers/slapd/back-meta/search.c +++ b/servers/slapd/back-meta/search.c @@ -800,7 +800,11 @@ really_bad:; /* * FIXME: need a better strategy to handle errors */ - rc = meta_back_op_result( mc, op, rs, META_TARGET_NONE ); + if ( mc ) { + rc = meta_back_op_result( mc, op, rs, META_TARGET_NONE ); + } else { + rc = rs->sr_err; + } goto finish; } -- 2.39.5