|
@@ -14568,6 +14568,9 @@ set_ports_option(struct mg_context *phys_ctx)
|
|
|
int portsTotal = 0;
|
|
|
int portsOk = 0;
|
|
|
|
|
|
+ const char* opt_txt;
|
|
|
+ long opt_max_connections;
|
|
|
+
|
|
|
if (!phys_ctx) {
|
|
|
return 0;
|
|
|
}
|
|
@@ -14734,12 +14737,12 @@ set_ports_option(struct mg_context *phys_ctx)
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
- const char* p = phys_ctx->dd.config[MAX_CONNECTIONS];
|
|
|
- const long opt_max_connections = strtol(p, NULL, 10);
|
|
|
- if(opt_max_connections > INT_MAX || opt_max_connections < 1) {
|
|
|
+ opt_txt = phys_ctx->dd.config[MAX_CONNECTIONS];
|
|
|
+ opt_max_connections = strtol(opt_txt, NULL, 10);
|
|
|
+ if ((opt_max_connections > INT_MAX) || (opt_max_connections < 1)) {
|
|
|
mg_cry_ctx_internal(phys_ctx,
|
|
|
"max_connections value \"%s\" is invalid",
|
|
|
- p);
|
|
|
+ opt_txt);
|
|
|
continue;
|
|
|
}
|
|
|
|