]> git.sur5r.net Git - openldap/commitdiff
make sure NULL pointers are not dereferenced
authorPierangelo Masarati <ando@openldap.org>
Thu, 4 May 2006 22:07:35 +0000 (22:07 +0000)
committerPierangelo Masarati <ando@openldap.org>
Thu, 4 May 2006 22:07:35 +0000 (22:07 +0000)
servers/slapd/back-meta/bind.c
servers/slapd/back-meta/search.c

index cc8fea04b81505c2e24edf6ec19c655cfb359bff..78ffc28ef60ecc226429be497cb4c7014be26328 100644 (file)
@@ -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 ];
 
index ef2a12991206b5539417d8c271f8d3a20f38537b..9cb55ccd7a899783422fc9db4bad93ac23906e7d 100644 (file)
@@ -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;
        }