Ensure control key is not empty before checking for equality.
authorJeremy Tan <[email protected]>
Thu, 3 Oct 2013 14:48:07 +0000 (22:48 +0800)
committerJeremy Tan <[email protected]>
Thu, 3 Oct 2013 14:48:07 +0000 (22:48 +0800)
server/fastcgi.c

index 41def56..f6bea43 100644 (file)
@@ -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
        }

UCC git Repository :: git.ucc.asn.au