[Freeipa-devel] [PATCH] ipa_pwd_extop.c (encrypt_encode_key): Handle malloc failure.
Simo Sorce
ssorce at redhat.com
Thu May 15 17:16:51 UTC 2008
On Wed, 2008-05-14 at 17:22 -0400, Simo Sorce wrote:
> On Wed, 2008-05-14 at 21:49 +0200, Jim Meyering wrote:
> > >From 5c162081daa0c66783f858a458cc2d08d6e208e0 Mon Sep 17 00:00:00 2001
> > From: Jim Meyering <meyering at redhat.com>
> > Date: Wed, 14 May 2008 11:03:52 +0200
> > Subject: [PATCH] * ipa_pwd_extop.c (encrypt_encode_key): Handle malloc failure.
> >
> > ---
> > .../ipa-pwd-extop/ipa_pwd_extop.c | 5 +++++
> > 1 files changed, 5 insertions(+), 0 deletions(-)
> >
> > diff --git a/ipa-server/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c b/ipa-server/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c
> > index 2bfa517..f07bbbf 100644
> > --- a/ipa-server/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c
> > +++ b/ipa-server/ipa-slapi-plugins/ipa-pwd-extop/ipa_pwd_extop.c
> > @@ -570,6 +570,11 @@ static Slapi_Value **encrypt_encode_key(krb5_context krbctx, struct ipapwd_data
> > if (krbTicketFlags & KTF_REQUIRES_PRE_AUTH) {
> > salt.length = KRB5P_SALT_SIZE;
> > salt.data = malloc(KRB5P_SALT_SIZE);
> > + if (!salt.data) {
> > + slapi_log_error(SLAPI_LOG_FATAL, "ipa_pwd_extop",
> > + "memory allocation failed\n");
> > + goto enc_error;
> > + }
> > krberr = krb5_c_random_make_octets(krbctx, &salt);
> > if (krberr) {
> > slapi_log_error(SLAPI_LOG_FATAL, "ipa_pwd_extop",
> > --
>
> ACK
Pushed to both master and ipa-1-0 branches
--
Simo Sorce * Red Hat, Inc * New York
More information about the Freeipa-devel
mailing list