[17228] in Kerberos_V5_Development

home help back first fref pref prev next nref lref last post

Re: [PATCH 4/4] Use gssalloc_malloc()/gssalloc_free() with

daemon@ATHENA.MIT.EDU (Nico Williams)
Wed Sep 28 17:03:08 2011

MIME-Version: 1.0
In-Reply-To: <1317239459-13699-5-git-send-email-hartmans@painless-security.com>
Date: Wed, 28 Sep 2011 16:03:03 -0500
Message-ID: <CAK3OfOiKoNvGSG=hv0=iSHmBu8Yw8xFqWO60y9CmNLpAV1KEOQ@mail.gmail.com>
From: Nico Williams <nico@cryptonector.com>
To: Sam Hartman <hartmans@painless-security.com>
Cc: kevin.wasserman@painless-security.com, krbdev@mit.edu
Content-Type: text/plain; charset="utf-8"
Errors-To: krbdev-bounces@mit.edu
Content-Transfer-Encoding: 8bit

On Wed, Sep 28, 2011 at 2:50 PM, Sam Hartman<hartmans@painless-security.com> wrote:> From: Kevin Wasserman <kevin.wasserman@painless-security.com>>> gss_buffer_t may be freed in a different module from where they> are allocated so it is not safe to use malloc/free.>> Signed-off-by: Kevin Wasserman <kevin.wasserman@painless-security.com>...

> diff --git a/src/appl/gss-sample/gss-client.c b/src/appl/gss-sample/gss-client.c> index 1cb797d..927681f 100644> --- a/src/appl/gss-sample/gss-client.c> +++ b/src/appl/gss-sample/gss-client.c> @@ -65,6 +65,7 @@>>  #include <gssapi/gssapi_generic.h>>  #include <gssapi/gssapi_krb5.h>> +#include <gssapi/gssapi_alloc.h>>  #include <gssapi/gssapi_ext.h>>  #include "gss-misc.h">  #include "port-sockets.h"> @@ -308,7 +309,7 @@ client_establish_context(int s, char *service_name, OM_uint32 gss_flags,>                                             NULL);  /* time_rec */>>             if (token_ptr != GSS_C_NO_BUFFER)> -                free(recv_tok.value);> +                gssalloc_free(recv_tok.value);
Er, no, none of the apps should be using new functions, onlygss_release_buffer() when they were free()ing (or, free() when theywere using gss_release_buffer() for application-allocated buffers).
Nico--
_______________________________________________krbdev mailing list             krbdev@mit.eduhttps://mailman.mit.edu/mailman/listinfo/krbdev

home help back first fref pref prev next nref lref last post