Ver Fonte

Ticket #48048 - Fix coverity issues - 2015/3/1

Coverity defect 13034 - Explicit null dereferenced (FORWARD_NULL)
Description:  Added NULL check for operation and sdn.
modified: update_pw_info in pw.c

https://fedorahosted.org/389/ticket/48048

Reviewed by [email protected] (Thank you, Rich!!)
Noriko Hosoi há 10 anos atrás
pai
commit
f6eeaf93ff
1 ficheiros alterados com 3 adições e 2 exclusões
  1. 3 2
      ldap/servers/slapd/pw.c

+ 3 - 2
ldap/servers/slapd/pw.c

@@ -636,8 +636,9 @@ update_pw_info ( Slapi_PBlock *pb , char *old_pw)
 	slapi_pblock_get( pb, SLAPI_TARGET_SDN, &sdn );
 	slapi_pblock_get( pb, SLAPI_REQUESTOR_NDN, &bind_dn);
 	slapi_pblock_get( pb, SLAPI_ENTRY_PRE_OP, &e);
-	if (NULL == e) {
-		slapi_log_error(SLAPI_LOG_FATAL, "pwdpolicy", "update_pw_info: no password entry \n");
+	if ((NULL == operation) || (NULL == sdn) || (NULL == e)){
+		slapi_log_error(SLAPI_LOG_FATAL, "pwdpolicy", 
+		                "update_pw_info: param error - no password entry/target dn/operation\n");
 		return -1;
 	}
 	internal_op = slapi_operation_is_flag_set(operation, SLAPI_OP_FLAG_INTERNAL);