Browse Source

Ticket #294 - 389 DS Segfaults during replica install in FreeIPA

https://fedorahosted.org/389/ticket/294
Resolves: Ticket #294
Bug Description: 389 DS Segfaults during replica install in FreeIPA
Reviewed by: mreynolds (Thanks!)
Branch: master
Fix Description: Have to check for NULL childnrdn return from
slapi_rdn_get_prev_ext().
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
Rich Megginson 14 years ago
parent
commit
9e65c7a35c
1 changed files with 8 additions and 6 deletions
  1. 8 6
      ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c

+ 8 - 6
ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c

@@ -2314,9 +2314,10 @@ _entryrdn_insert_key(backend *be,
                         goto bail;
                     } else {
                         int tmpidx = slapi_rdn_get_prev_ext(srdn, rdnidx,
-                                                    &childnrdn, FLAG_ALL_NRDNS);
-                        if (0 == strncasecmp(childnrdn, SLAPI_ATTR_UNIQUEID,
-                                             sizeof(SLAPI_ATTR_UNIQUEID) - 1)) {
+                                                            &childnrdn, FLAG_ALL_NRDNS);
+                        if (childnrdn &&
+                            (0 == strncasecmp(childnrdn, SLAPI_ATTR_UNIQUEID,
+                                              sizeof(SLAPI_ATTR_UNIQUEID) - 1))) {
                             rdnidx = tmpidx;
                         }
                     }
@@ -2824,9 +2825,10 @@ _entryrdn_index_read(backend *be,
                     goto bail;
                 } else {
                     int tmpidx = slapi_rdn_get_prev_ext(srdn, rdnidx,
-                                                    &childnrdn, FLAG_ALL_NRDNS);
-                    if (0 == strncasecmp(childnrdn, SLAPI_ATTR_UNIQUEID,
-                                             sizeof(SLAPI_ATTR_UNIQUEID) - 1)) {
+                                                        &childnrdn, FLAG_ALL_NRDNS);
+                    if (childnrdn &&
+                        (0 == strncasecmp(childnrdn, SLAPI_ATTR_UNIQUEID,
+                                          sizeof(SLAPI_ATTR_UNIQUEID) - 1))) {
                         rdnidx = tmpidx;
                     }
                 }