neocgit

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

commit 590ba455d694deaf2ec206510cf7f047ac365a96
parent c19d983ed7b86face56e41effea4fffcf9ad1e19
Author: Eric Wong <normalperson@yhbt.net>
Date:   Wed,  6 Jul 2016 07:08:01 +0000

ui-shared: fix segfault when defbranch is NULL

Not sure if there's a better fix for this.  defbranch is
NULL here on my setup when a crawler hit an invalid URL,
causing strcmp to segfault.

Signed-off-by: Eric Wong <normalperson@yhbt.net>

Diffstat:
Mui-shared.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ui-shared.c b/ui-shared.c @@ -253,7 +253,7 @@ static char *repolink(const char *title, const char *class, const char *page, } delim = "&amp;"; } - if (head && strcmp(head, ctx.repo->defbranch)) { + if (head && ctx.repo->defbranch && strcmp(head, ctx.repo->defbranch)) { html(delim); html("h="); html_url_arg(head);