From c699866699411346c5dba406457581013f85a873 Mon Sep 17 00:00:00 2001 From: John Keeping Date: Sun, 19 Feb 2017 12:17:05 +0000 Subject: parsing: clear query path before starting By specifying the "url" query parameter multiple times it is possible to end up with ctx.qry.vpath set while ctx.repo is null, which triggers an invalid code path from cgit_print_pageheader() while printing path crumbs, resulting in a null dereference. The previous patch fixed this segfault, but it makes no sense for us to clear ctx.repo while leaving ctx.qry.path set to the previous value, so let's just clear it here so that the last "url" parameter given takes full effect rather than partially overriding the effect of the previous value. Signed-off-by: John Keeping --- parsing.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'parsing.c') diff --git a/parsing.c b/parsing.c index 9dacb16..b8d7f10 100644 --- a/parsing.c +++ b/parsing.c @@ -21,6 +21,7 @@ void cgit_parse_url(const char *url) struct cgit_repo *repo; ctx.repo = NULL; + ctx.qry.page = NULL; if (!url || url[0] == '\0') return; @@ -53,7 +54,6 @@ void cgit_parse_url(const char *url) } if (cmd[1]) ctx.qry.page = xstrdup(cmd + 1); - return; } } -- cgit 1.4.1 f90b09e5c0b0d5a91dd2d789842369b44b8b900&follow=1'>commit diff
Commit message (Collapse)Author
2019-02-10Generate html for binsJune McEnroe
2019-02-10Use italic for underline in nvim man modeJune McEnroe
This doesn't yet work in Terminal.app: <https://github.com/neovim/neovim/issues/9598>.
2019-02-10Add plain text "language" to hiJune McEnroe
2019-02-10Don't match DQ string inside SQ stringJune McEnroe
2019-02-10Skip only one character if a match fails due to parentJune McEnroe
Really it should skip forward until the parent changes, but this is simpler.
2019-02-10Remove pattend from hiJune McEnroe
2019-02-10Replace uses of pattend with newline patternsJune McEnroe
2019-02-10Add hi debug outputJune McEnroe
2019-02-10Actually do HTML &quot; escapingJune McEnroe
2019-02-10Set git commit.verboseJune McEnroe
2019-02-10Add back missing static keywordJune McEnroe