From: Howard Chu Date: Wed, 9 Mar 2011 18:22:50 +0000 (+0000) Subject: ITS#6858 fix segv if adding values out of order X-Git-Tag: MIGRATION_CVS2GIT~27 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=db13bc1d4ce96f1a658aefb9627b09dd4578dfc2;p=openldap ITS#6858 fix segv if adding values out of order --- diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c index d38cbc3606..1a4cdccbb0 100644 --- a/servers/slapd/bconfig.c +++ b/servers/slapd/bconfig.c @@ -1766,7 +1766,8 @@ config_generic(ConfigArgs *c) { int i; for (i=0, oc = cfn->c_oc_head; ivalx; i++) { prev = oc; - oc_next( &oc ); + if ( !oc_next( &oc )) + break; } } else /* If adding the first, and head exists, find its prev */ @@ -1798,7 +1799,8 @@ config_generic(ConfigArgs *c) { int i; for (i=0, at = cfn->c_at_head; ivalx; i++) { prev = at; - at_next( &at ); + if ( !at_next( &at )) + break; } } else /* If adding the first, and head exists, find its prev */ @@ -1830,7 +1832,8 @@ config_generic(ConfigArgs *c) { int i; for ( i = 0, syn = cfn->c_syn_head; i < c->valx; i++ ) { prev = syn; - syn_next( &syn ); + if ( !syn_next( &syn )) + break; } } else /* If adding the first, and head exists, find its prev */