Bladeren bron

Bug 630097 - (cov#12182,12183) NULL dereference in import code

The entry pointer that is passed to slapi_entry_attr_find() is
dereferenced by that function without a check for NULL.  We should
check if ep->ep_entry is NULL before calling slapi_entry_attr_find().
Nathan Kinder 15 jaren geleden
bovenliggende
commit
b35cc7e0ff
1 gewijzigde bestanden met toevoegingen van 2 en 2 verwijderingen
  1. 2 2
      ldap/servers/slapd/back-ldbm/import-threads.c

+ 2 - 2
ldap/servers/slapd/back-ldbm/import-threads.c

@@ -634,7 +634,7 @@ import_producer(void *param)
         }
         }
 
 
         ep = import_make_backentry(e, id);
         ep = import_make_backentry(e, id);
-        if (!ep) {
+        if ((ep == NULL) || (ep->ep_entry == NULL)) {
             slapi_entry_free(e);
             slapi_entry_free(e);
             goto error;
             goto error;
         }
         }
@@ -2734,7 +2734,7 @@ static int bulk_import_queue(ImportJob *job, Slapi_Entry *entry)
 
 
     /* make into backentry */
     /* make into backentry */
     ep = import_make_backentry(entry, id);
     ep = import_make_backentry(entry, id);
-    if (!ep) {
+    if ((ep == NULL) || (ep->ep_entry == NULL)) {
         import_abort_all(job, 1);
         import_abort_all(job, 1);
         PR_Unlock(job->wire_lock);
         PR_Unlock(job->wire_lock);
         return -1;
         return -1;