From 3a8432437934a0a95f2618b534b1f5b3494d6b18 Mon Sep 17 00:00:00 2001 From: Lukas Fleischer Date: Mon, 1 Apr 2013 17:11:14 +0200 Subject: Maŕk cgit_environment members const MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These reflect the values of environment variables and should never be changed. Add another xstrdup() when we assign environment variables to strings that are potentially non-constant. Signed-off-by: Lukas Fleischer --- cgit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cgit.c') diff --git a/cgit.c b/cgit.c index afafcce..d145f8a 100644 --- a/cgit.c +++ b/cgit.c @@ -401,9 +401,9 @@ static void prepare_context(struct cgit_context *ctx) ctx->page.etag = NULL; memset(&ctx->cfg.mimetypes, 0, sizeof(struct string_list)); if (ctx->env.script_name) - ctx->cfg.script_name = ctx->env.script_name; + ctx->cfg.script_name = xstrdup(ctx->env.script_name); if (ctx->env.query_string) - ctx->qry.raw = ctx->env.query_string; + ctx->qry.raw = xstrdup(ctx->env.query_string); if (!ctx->env.cgit_config) ctx->env.cgit_config = CGIT_CONFIG; } -- cgit 1.4.1