소스 검색

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 년 전
부모
커밋
b35cc7e0ff
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  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);
-        if (!ep) {
+        if ((ep == NULL) || (ep->ep_entry == NULL)) {
             slapi_entry_free(e);
             goto error;
         }
@@ -2734,7 +2734,7 @@ static int bulk_import_queue(ImportJob *job, Slapi_Entry *entry)
 
     /* make into backentry */
     ep = import_make_backentry(entry, id);
-    if (!ep) {
+    if ((ep == NULL) || (ep->ep_entry == NULL)) {
         import_abort_all(job, 1);
         PR_Unlock(job->wire_lock);
         return -1;