summaryrefslogtreecommitdiffstats
path: root/daemons/ipa-slapi-plugins
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2011-09-16 11:42:18 -0400
committerRob Crittenden <rcritten@redhat.com>2011-09-21 16:05:02 -0400
commit37836a2e6c07550d504a1075ea5626f160f13342 (patch)
tree07a008f56e90522f37040864fe3dcbe08a1bcb07 /daemons/ipa-slapi-plugins
parentffd760c1002cfe6b27d140affa8e0608696d3668 (diff)
downloadfreeipa-37836a2e6c07550d504a1075ea5626f160f13342.tar.gz
freeipa-37836a2e6c07550d504a1075ea5626f160f13342.tar.xz
freeipa-37836a2e6c07550d504a1075ea5626f160f13342.zip
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.
Diffstat (limited to 'daemons/ipa-slapi-plugins')
-rw-r--r--daemons/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c7
1 files changed, 7 insertions, 0 deletions
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 f9f538976..9fdf17713 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
@@ -162,6 +162,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";