From: Jeremy Tan Date: Thu, 3 Oct 2013 14:48:07 +0000 (+0800) Subject: Ensure control key is not empty before checking for equality. X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=a304c5e3c9ef6f145b7e30ebc618e03e749cba95;p=matches%2FMCTX3420.git Ensure control key is not empty before checking for equality. --- 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 }