From 355b93ecf3fa130674b1888bec97e9c600bc7a95 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Fri, 16 Sep 2011 11:42:18 -0400 Subject: [PATCH] ipa-pwd-extop: Fix segfault in password change. Do not pass an empty buffer to ber_init() as it will assert. Check before hand and return an error. --- daemons/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c b/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c index 259138d9a..921e9875e 100644 --- a/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c +++ b/daemons/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c @@ -150,6 +150,13 @@ static int ipapwd_chpwop(Slapi_PBlock *pb, struct ipapwd_krbcfg *krbcfg) /* Get the ber value of the extended operation */ slapi_pblock_get(pb, SLAPI_EXT_OP_REQ_VALUE, &extop_value); + if (extop_value == NULL || + (extop_value->bv_len == 0 || extop_value->bv_val == NULL)) { + errMesg = "PasswdModify Request empty.\n"; + rc = LDAP_UNWILLING_TO_PERFORM; + goto free_and_return; + } + if ((ber = ber_init(extop_value)) == NULL) { errMesg = "PasswdModify Request decode failed.\n";