mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-23 16:19:35 -05:00
ITS#7256 Add some necessary checks.
This commit is contained in:
parent
304c0cbbff
commit
fde1f80aa8
1 changed files with 139 additions and 134 deletions
|
|
@ -282,7 +282,8 @@ slapmodify( int argc, char **argv )
|
|||
e = e_tmp;
|
||||
}
|
||||
|
||||
for ( n = 0; lr.lrop_mods[ n ] != NULL; n++ ) {
|
||||
if ( lr.lrop_mods ) {
|
||||
for ( n = 0; lr.lrop_mods && lr.lrop_mods[ n ] != NULL; n++ ) {
|
||||
LDAPMod *mod = lr.lrop_mods[ n ];
|
||||
Modification mods = { 0 };
|
||||
unsigned i = 0;
|
||||
|
|
@ -327,12 +328,15 @@ slapmodify( int argc, char **argv )
|
|||
;
|
||||
}
|
||||
|
||||
if ( i != 0 )
|
||||
{
|
||||
mods.sm_values = SLAP_CALLOC( sizeof( struct berval ), i + 1 );
|
||||
if ( normalize ) {
|
||||
mods.sm_nvalues = SLAP_CALLOC( sizeof( struct berval ), i + 1 );
|
||||
} else {
|
||||
mods.sm_nvalues = NULL;
|
||||
}
|
||||
}
|
||||
mods.sm_numvals = i;
|
||||
|
||||
for ( i = 0; i < mods.sm_numvals; i++ ) {
|
||||
|
|
@ -449,6 +453,7 @@ slapmodify( int argc, char **argv )
|
|||
entry_free( e );
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( SLAP_LASTMOD(be) ) {
|
||||
time_t now = slap_get_time();
|
||||
|
|
|
|||
Loading…
Reference in a new issue