From 11d2c004c245ef74ed480f0b1192a71cdad85ae3 Mon Sep 17 00:00:00 2001 From: colinlbc Date: Thu, 25 Oct 2012 14:30:47 -0700 Subject: [PATCH] moved critical scrncpy out of #ifdef UWSGI_DEBUG --- plugins/router_access/router_access.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/router_access/router_access.c b/plugins/router_access/router_access.c index 44e24443..d62fa34c 100644 --- a/plugins/router_access/router_access.c +++ b/plugins/router_access/router_access.c @@ -25,9 +25,10 @@ int uwsgi_routing_func_access(struct wsgi_request *wsgi_req, struct uwsgi_route #ifdef UWSGI_DEBUG uwsgi_log("Access: Parsing router: %s\n", ur->data); - strncpy(access_data, ur->data, 0xff); #endif + strncpy(access_data, ur->data, 0xff); + if (strchr(access_data, '=')){ // parse router config: action=param access_action = strtok(access_data, "="); @@ -45,12 +46,11 @@ int uwsgi_routing_func_access(struct wsgi_request *wsgi_req, struct uwsgi_route // set default access_action, access_param if no colon found access_action = "hosts"; access_param = "uwsgi"; + } #ifdef UWSGI_DEBUG - uwsgi_log("Access: Using defaults: access_action = %s, access_param = %s\n", access_action, access_param); + uwsgi_log("Access: access_action = %s, access_param = %s\n", access_action, access_param); #endif - - } if (!strncmp(access_action, "hosts", 4)){ // syntax access:hosts=svcname to use hosts.allow, hosts.deny with svcname as daemon name