From df3b904f066358f19767107942c949af16b68f30 Mon Sep 17 00:00:00 2001 From: Alexander Chernov Date: Thu, 31 Oct 2024 08:37:16 +0300 Subject: [PATCH] fix bugs --- lib/new_server_html.c | 2 +- lib/prepare.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/new_server_html.c b/lib/new_server_html.c index 722dbff6a..edcebb29b 100644 --- a/lib/new_server_html.c +++ b/lib/new_server_html.c @@ -14007,7 +14007,7 @@ unpriv_submit_run( errno = 0; char *ep = NULL; long v = strtol(s, &ep, 10); - if (!errno && !*ep && ep != (const char *) s && v > 0 && v < cs->max_prob && cs->probs[v]) { + if (!errno && !*ep && ep != (const char *) s && v > 0 && v <= cs->max_prob && cs->probs[v]) { prob_id = v; prob = cs->probs[prob_id]; } diff --git a/lib/prepare.c b/lib/prepare.c index d838f0b21..a2ef9e77e 100644 --- a/lib/prepare.c +++ b/lib/prepare.c @@ -7373,6 +7373,7 @@ compile_servers_config_free(struct compile_server_configs *cscs) xfree(csc->id); xfree(csc->langs); } + free(cscs->v); memset(cscs, 0xff, sizeof(*cscs)); }