mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-11 09:22:54 -05:00
make sure n,o are non-zero, so j is initialized (coverity)
This commit is contained in:
parent
9beb9f9f51
commit
04cf328716
1 changed files with 5 additions and 0 deletions
|
|
@ -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 );
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue