浏览代码

Bug 750625 - Fix Coverity (11065) Uninitialized pointer read

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

plugins/pam_passthru/pam_ptimpl.c (do_one_pam_auth)

Bug Description: Using uninitialized value "pam_id.str" when
calling "delete_my_str_buf".

Fix Description: Initialize pam_id.str with NULL in case bindsdn
is NULL.
Noriko Hosoi 14 年之前
父节点
当前提交
f67d3ba0e5
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      ldap/servers/plugins/pam_passthru/pam_ptimpl.c

+ 1 - 0
ldap/servers/plugins/pam_passthru/pam_ptimpl.c

@@ -280,6 +280,7 @@ do_one_pam_auth(
 	if (NULL == bindsdn) {
 	if (NULL == bindsdn) {
 		errmsg = PR_smprintf("Null bind dn");
 		errmsg = PR_smprintf("Null bind dn");
 		retcode = LDAP_OPERATIONS_ERROR;
 		retcode = LDAP_OPERATIONS_ERROR;
+		pam_id.str = NULL; /* initialize pam_id.str */
 		goto done; /* skip the pam stuff */
 		goto done; /* skip the pam stuff */
 	}
 	}
 	binddn = slapi_sdn_get_dn(bindsdn);
 	binddn = slapi_sdn_get_dn(bindsdn);