all repos — cgit @ 590ba455d694deaf2ec206510cf7f047ac365a96

a hyperfast web frontend for git written in c

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>
Eric Wong normalperson@yhbt.net
Wed, 06 Jul 2016 07:08:01 +0000
commit

590ba455d694deaf2ec206510cf7f047ac365a96

parent

c19d983ed7b86face56e41effea4fffcf9ad1e19

1 files changed, 1 insertions(+), 1 deletions(-)

jump to
M ui-shared.cui-shared.c

@@ -253,7 +253,7 @@ html_url_arg(path);

} 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);