neocgit

a more 'modern' version of cgit
Log | Files | Refs | Submodules | README | LICENSE | git clone https://git.ne02ptzero.me/git/neocgit

commit da1b89710f5eb25297a66613ff3130b2a31cb86a
parent 559ab5ecc4445c8477ecf62c9fc97efa412dd562
Author: Lukas Fleischer <lfleischer@lfos.de>
Date:   Sun, 13 Dec 2015 01:27:13 +0100

Fix segmentation fault in hc()

The ctx.qry.page variable might be unset at this point, e.g. when an
invalid command is passed and cgit_print_pageheader() is called to show
an error message.

Signed-off-by: Lukas Fleischer <lfleischer@lfos.de>

Diffstat:
Mui-shared.c | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/ui-shared.c b/ui-shared.c @@ -889,6 +889,9 @@ void cgit_add_hidden_formfields(int incl_head, int incl_search, static const char *hc(const char *page) { + if (!ctx.qry.page) + return NULL; + return strcmp(ctx.qry.page, page) ? NULL : "active"; }