From b2a3ed84549a7e93593259e0fee6225ccacfa1e3 Mon Sep 17 00:00:00 2001 From: arshidkv12 Date: Wed, 25 Mar 2026 20:52:56 +0530 Subject: [PATCH] Cache strlen(status) to avoid repeated calls in loop --- sapi/fpm/fpm/fpm_conf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c index 3979d875a18e..a13c91e8facc 100644 --- a/sapi/fpm/fpm/fpm_conf.c +++ b/sapi/fpm/fpm/fpm_conf.c @@ -972,7 +972,8 @@ static int fpm_conf_process_all_pools(void) return -1; } - for (i = 0; i < strlen(status); i++) { + size_t status_len = strlen(status); + for (i = 0; i < status_len; i++) { if (!isalnum(status[i]) && status[i] != '/' && status[i] != '-' && status[i] != '_' && status[i] != '.' && status[i] != '~') { zlog(ZLOG_ERROR, "[pool %s] the status path '%s' must contain only the following characters '[alphanum]/_-.~'", wp->config->name, status); return -1; @@ -995,7 +996,8 @@ static int fpm_conf_process_all_pools(void) return -1; } - for (i = 0; i < strlen(ping); i++) { + size_t ping_len = strlen(ping); + for (i = 0; i < ping_len; i++) { if (!isalnum(ping[i]) && ping[i] != '/' && ping[i] != '-' && ping[i] != '_' && ping[i] != '.' && ping[i] != '~') { zlog(ZLOG_ERROR, "[pool %s] the ping path '%s' must contain only the following characters '[alphanum]/_-.~'", wp->config->name, ping); return -1;