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>
This commit is contained in:
Lukas Fleischer 2015-12-13 01:27:13 +01:00 committed by Jason A. Donenfeld
부모 559ab5ecc4
커밋 da1b89710f
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제

파일 보기

@ -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";
}