浏览代码

Bug 750625 - Fix Coverity (11055) Explicit null dereferenced

https://bugzilla.redhat.com/show_bug.cgi?id=750625

plugins/automember/automember.c (automember_pre_op)

Bug Description: Passing null variable "e" to function
"automember_parse_config_entry", which dereferences it.
Missing a check of the NULL possibility of target entry "e".

Fix Description: Check if "e" is NULL or not.  If it is, goto "bail".
Noriko Hosoi 14 年之前
父节点
当前提交
0ae39ce5b3
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      ldap/servers/plugins/automember/automember.c

+ 5 - 0
ldap/servers/plugins/automember/automember.c

@@ -1593,6 +1593,11 @@ automember_pre_op(Slapi_PBlock * pb, int modop)
         if (LDAP_CHANGETYPE_ADD == modop) {
             slapi_pblock_get(pb, SLAPI_ADD_ENTRY, &e);
 
+            /* If the entry doesn't exist, just bail and
+             * let the server handle it. */
+            if (e == NULL) {
+                goto bail;
+            }
         } else if (LDAP_CHANGETYPE_MODIFY == modop) {
             /* Fetch the entry being modified so we can
              * create the resulting entry for validation. */