]> git.sur5r.net Git - openldap/commitdiff
ITS#6858 fix segv if adding values out of order
authorHoward Chu <hyc@openldap.org>
Wed, 9 Mar 2011 18:22:50 +0000 (18:22 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 9 Mar 2011 18:22:50 +0000 (18:22 +0000)
servers/slapd/bconfig.c

index d38cbc36068230d777eb92fb0cf7a1531dc10454..1a4cdccbb0d2e25d99b3041bf31853a617051c04 100644 (file)
@@ -1766,7 +1766,8 @@ config_generic(ConfigArgs *c) {
                                        int i;
                                        for (i=0, oc = cfn->c_oc_head; i<c->valx; 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; i<c->valx; 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 */