From 6d0f970b3441b5980cff69eeb636963558b1e617 Mon Sep 17 00:00:00 2001 From: Michael Rash Date: Sun, 12 May 2013 15:02:31 -0400 Subject: [PATCH] [libfko] bug fix to apply ctx initialization check before attempting to use ctx->message_type in fko_set_spa_client_timeout() --- lib/fko_client_timeout.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/fko_client_timeout.c b/lib/fko_client_timeout.c index abfe49b3..6a62223c 100644 --- a/lib/fko_client_timeout.c +++ b/lib/fko_client_timeout.c @@ -36,7 +36,7 @@ int fko_set_spa_client_timeout(fko_ctx_t ctx, const int timeout) { - int old_msg_type = ctx->message_type; + int old_msg_type; /* Context must be initialized. */ @@ -48,6 +48,8 @@ fko_set_spa_client_timeout(fko_ctx_t ctx, const int timeout) if(timeout < 0) return(FKO_ERROR_INVALID_DATA); + old_msg_type = ctx->message_type; + ctx->client_timeout = timeout; ctx->state |= FKO_DATA_MODIFIED;