mirror of
https://git.zx2c4.com/cgit
synced 2024-11-22 08:28:42 +00:00
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>
This commit is contained in:
parent
c19d983ed7
commit
590ba455d6
@ -253,7 +253,7 @@ static char *repolink(const char *title, const char *class, const char *page,
|
|||||||
}
|
}
|
||||||
delim = "&";
|
delim = "&";
|
||||||
}
|
}
|
||||||
if (head && strcmp(head, ctx.repo->defbranch)) {
|
if (head && ctx.repo->defbranch && strcmp(head, ctx.repo->defbranch)) {
|
||||||
html(delim);
|
html(delim);
|
||||||
html("h=");
|
html("h=");
|
||||||
html_url_arg(head);
|
html_url_arg(head);
|
||||||
|
Loading…
Reference in New Issue
Block a user