]> git.sur5r.net Git - openldap/commitdiff
make sure n,o are non-zero, so j is initialized (coverity)
authorPierangelo Masarati <ando@openldap.org>
Mon, 3 Sep 2007 16:31:33 +0000 (16:31 +0000)
committerPierangelo Masarati <ando@openldap.org>
Mon, 3 Sep 2007 16:31:33 +0000 (16:31 +0000)
servers/slapd/syncrepl.c

index af5b81d446d2b6c8c1934271c46fbd7aab9a6709..db87e5205c5519e5006cece61759d1b6f7589215 100644 (file)
@@ -2695,6 +2695,11 @@ attr_cmp( Operation *op, Attribute *old, Attribute *new,
                for ( o=0; old->a_vals[o].bv_val; o++ ) ;
                for ( n=0; new->a_vals[n].bv_val; n++ ) ;
 
+               /* there MUST be both onld and new values
+                * (otherwise j is used uninitialized) */
+               assert( o != 0 );
+               assert( n != 0 );
+
                adds = op->o_tmpalloc( sizeof(struct berval *) * n, op->o_tmpmemctx );
                dels = op->o_tmpalloc( sizeof(struct berval *) * o, op->o_tmpmemctx );