From a304c5e3c9ef6f145b7e30ebc618e03e749cba95 Mon Sep 17 00:00:00 2001 From: Jeremy Tan Date: Thu, 3 Oct 2013 22:48:07 +0800 Subject: [PATCH] Ensure control key is not empty before checking for equality. --- server/fastcgi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/fastcgi.c b/server/fastcgi.c index 41def56..f6bea43 100644 --- a/server/fastcgi.c +++ b/server/fastcgi.c @@ -116,7 +116,8 @@ void FCGI_LockControl(FCGIContext *context, bool force) { bool FCGI_HasControl(FCGIContext *context, const char *key) { time_t now = time(NULL); int result = (now - context->control_timestamp) <= CONTROL_TIMEOUT && - key != NULL && !strcmp(context->control_key, key); + key != NULL && context->control_key[0] != '\0' && + !strcmp(context->control_key, key); if (result) { context->control_timestamp = now; //Update the control_timestamp } -- 2.20.1