diff options
author | Lukas Fleischer <cgit@cryptocrack.de> | 2013-04-02 00:11:14 (JST) |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2013-04-08 22:43:17 (JST) |
commit | 3a8432437934a0a95f2618b534b1f5b3494d6b18 (patch) | |
tree | 6e7dd26d45c4f10c60dc762a11071f1787a79443 /cgit.c | |
parent | 996f86e664ab6d00a9304a42374e9c691b78ca6b (diff) | |
download | cgit-3a8432437934a0a95f2618b534b1f5b3494d6b18.zip cgit-3a8432437934a0a95f2618b534b1f5b3494d6b18.tar.gz |
Maŕk cgit_environment members const
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@cryptocrack.de>
Diffstat (limited to 'cgit.c')
-rw-r--r-- | cgit.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -401,9 +401,9 @@ static void prepare_context(struct cgit_context *ctx) | |||
401 | ctx->page.etag = NULL; | 401 | ctx->page.etag = NULL; |
402 | memset(&ctx->cfg.mimetypes, 0, sizeof(struct string_list)); | 402 | memset(&ctx->cfg.mimetypes, 0, sizeof(struct string_list)); |
403 | if (ctx->env.script_name) | 403 | if (ctx->env.script_name) |
404 | ctx->cfg.script_name = ctx->env.script_name; | 404 | ctx->cfg.script_name = xstrdup(ctx->env.script_name); |
405 | if (ctx->env.query_string) | 405 | if (ctx->env.query_string) |
406 | ctx->qry.raw = ctx->env.query_string; | 406 | ctx->qry.raw = xstrdup(ctx->env.query_string); |
407 | if (!ctx->env.cgit_config) | 407 | if (!ctx->env.cgit_config) |
408 | ctx->env.cgit_config = CGIT_CONFIG; | 408 | ctx->env.cgit_config = CGIT_CONFIG; |
409 | } | 409 | } |