From d8d0e659ceacdf24227f76b2ef176eda270ebbc4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Fri, 31 Jan 2014 08:45:29 +0100 Subject: [PATCH] make sure h is set at when we find a match, from [GITHUB #54] --- lib/hdb/hdb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/hdb/hdb.c b/lib/hdb/hdb.c index 9f0f450c7..3a6dd44c4 100644 --- a/lib/hdb/hdb.c +++ b/lib/hdb/hdb.c @@ -391,10 +391,12 @@ struct cb_s { static krb5_error_code KRB5_LIB_CALL callback(krb5_context context, const void *plug, void *plugctx, void *userctx) { + const struct hdb_method *h = (const struct hdb_method *)plug; struct cb_s *cb_ctx = (struct cb_s *)userctx; - if (strncmp (cb_ctx->filename, cb_ctx->h->prefix, strlen(cb_ctx->h->prefix)) == 0) { - cb_ctx->residual = cb_ctx->filename + strlen(cb_ctx->h->prefix); + if (strncmp(cb_ctx->filename, h->prefix, strlen(h->prefix)) == 0) { + cb_ctx->residual = cb_ctx->filename + strlen(h->prefix); + cb_ctx->h = h; return 0; } return KRB5_PLUGIN_NO_HANDLE; -- 2.11.4.GIT