all repos — cgit @ 21418ec42a9a2de4c2c22eca7a1183b311914eca

a hyperfast web frontend for git written in c

segfault fix on some bogus requests

ctx.qry.head can be NULL in some cases due to bad requests
by weird bots.  I managed to reproduce with:

   PATH_INFO=/repo.git/shop.php QUERY_STRING=id=

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Eric Wong normalperson@yhbt.net
Wed, 04 Jan 2012 09:01:51 +0000
commit

21418ec42a9a2de4c2c22eca7a1183b311914eca

parent

6a575b8900734a4640427416885e73c83af70736

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

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

@@ -294,7 +294,7 @@ {

char *delim; delim = repolink(title, class, "log", head, path); - if (rev && strcmp(rev, ctx.qry.head)) { + if (rev && ctx.qry.head && strcmp(rev, ctx.qry.head)) { html(delim); html("id="); html_url_arg(rev);

@@ -338,7 +338,7 @@

char *delim; delim = repolink(title, class, "commit", head, path); - if (rev && strcmp(rev, ctx.qry.head)) { + if (rev && ctx.qry.head && strcmp(rev, ctx.qry.head)) { html(delim); html("id="); html_url_arg(rev);