From db13bc1d4ce96f1a658aefb9627b09dd4578dfc2 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 9 Mar 2011 18:22:50 +0000 Subject: [PATCH] ITS#6858 fix segv if adding values out of order --- servers/slapd/bconfig.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 */ -- 2.39.5