mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Unchecked return value of calloc
Omiting return value of calloc in ipa_pwd_extop.c could lead to memory access issues when memory is full. This patch adds return value check. https://fedorahosted.org/freeipa/ticket/717
This commit is contained in:
committed by
Rob Crittenden
parent
5a0c9371cb
commit
d03ffeabe2
@@ -853,6 +853,13 @@ static int ipapwd_setkeytab(Slapi_PBlock *pb, struct ipapwd_krbcfg *krbcfg)
|
||||
char * enrolledBy = slapi_entry_attr_get_charptr(targetEntry, "enrolledBy");
|
||||
if (NULL == enrolledBy) {
|
||||
evals = (Slapi_Value **)calloc(2, sizeof(Slapi_Value *));
|
||||
|
||||
if (!evals) {
|
||||
LOG_OOM();
|
||||
slapi_mods_free(&smods);
|
||||
goto free_and_return;
|
||||
}
|
||||
|
||||
evals[0] = slapi_value_new_string(bindDN);
|
||||
slapi_mods_add_mod_values(smods, LDAP_MOD_ADD, "enrolledBy", evals);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user