]> git.sur5r.net Git - openldap/commitdiff
Fix schema undo crash
authorHoward Chu <hyc@openldap.org>
Sun, 2 Sep 2007 23:47:49 +0000 (23:47 +0000)
committerHoward Chu <hyc@openldap.org>
Sun, 2 Sep 2007 23:47:49 +0000 (23:47 +0000)
servers/slapd/bconfig.c

index fd57476fda9443c4679b34c37938b2979f4bf29e..79b99d1fec32cde3da176ac389333daf91bf9a7a 100644 (file)
@@ -1149,10 +1149,14 @@ config_generic(ConfigArgs *c) {
                        break;
 
                case CFG_OC: {
-                       CfEntryInfo *ce = c->ca_entry->e_private;
-                       /* can't modify the hardcoded schema */
-                       if ( ce->ce_parent->ce_type == Cft_Global )
-                               return 1;
+                       CfEntryInfo *ce;
+                       /* Can be NULL when undoing a failed add */
+                       if ( c->ca_entry ) {
+                               ce = c->ca_entry->e_private;
+                               /* can't modify the hardcoded schema */
+                               if ( ce->ce_parent->ce_type == Cft_Global )
+                                       return 1;
+                               }
                        }
                        cfn = c->private;
                        if ( c->valx < 0 ) {
@@ -1183,10 +1187,14 @@ config_generic(ConfigArgs *c) {
                        break;
 
                case CFG_ATTR: {
-                       CfEntryInfo *ce = c->ca_entry->e_private;
-                       /* can't modify the hardcoded schema */
-                       if ( ce->ce_parent->ce_type == Cft_Global )
-                               return 1;
+                       CfEntryInfo *ce;
+                       /* Can be NULL when undoing a failed add */
+                       if ( c->ca_entry ) {
+                               ce = c->ca_entry->e_private;
+                               /* can't modify the hardcoded schema */
+                               if ( ce->ce_parent->ce_type == Cft_Global )
+                                       return 1;
+                               }
                        }
                        cfn = c->private;
                        if ( c->valx < 0 ) {