Commit 04cf3287 authored by Pierangelo Masarati's avatar Pierangelo Masarati
Browse files

make sure n,o are non-zero, so j is initialized (coverity)

parent 9beb9f9f
......@@ -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 );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment