From 19fb8061885326dc0acc689b292b04acfb3ef7da Mon Sep 17 00:00:00 2001 From: Simon Josefsson Date: Tue, 22 Aug 2006 15:02:35 +0000 Subject: [PATCH] (gsasl_finish): Don't crash on sctx's without mech pointer, happens if you call gsasl_client_start or gsasl_server_start with unknown mechanism. --- lib/src/xfinish.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/xfinish.c b/lib/src/xfinish.c index fd41d02..ef12d80 100644 --- a/lib/src/xfinish.c +++ b/lib/src/xfinish.c @@ -1,5 +1,5 @@ /* xfinish.c --- Finish libgsasl session. - * Copyright (C) 2002, 2003, 2004, 2005 Simon Josefsson + * Copyright (C) 2002, 2003, 2004, 2005, 2006 Simon Josefsson * * This file is part of GNU SASL Library. * @@ -34,12 +34,12 @@ gsasl_finish (Gsasl_session * sctx) { if (sctx->clientp) { - if (sctx->mech->client.finish) + if (sctx->mech && sctx->mech->client.finish) sctx->mech->client.finish (sctx, sctx->mech_data); } else { - if (sctx->mech->server.finish) + if (sctx->mech && sctx->mech->server.finish) sctx->mech->server.finish (sctx, sctx->mech_data); } -- 2.11.4.GIT