Commit fde1f80a authored by Ondrej Kuznik's avatar Ondrej Kuznik Committed by Howard Chu
Browse files

ITS#7256 Add some necessary checks.

parent 304c0cbb
......@@ -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();
......
Supports Markdown
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