Diff options
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Trim a snapshot name without reading out of bounds
For a url of .git, or an empty one, repo_basename stepped its index to the byte before its buffer, read it, and would have cleared it had it held a slash. Git's strbuf trims take the same steps safely, and they lift the 1024-byte cap that failed the page for a longer url.
Diffstat (limited to '')
-rw-r--r--source/ui-shared.h3
1 file changed, 2 insertions, 1 deletion
diff --git a/source/ui-shared.h b/source/ui-shared.h
index da1b889..9abd4c0 100644
--- a/source/ui-shared.h
+++ b/source/ui-shared.h
@@ -125,7 +125,8 @@ extern void cgit_print_snapshot_links(const struct cgit_repo *repo, const char *
/*
* The name a snapshot of this repository is downloaded under, which is the
- * configured prefix or the last component of the repository URL.
+ * configured prefix or the last component of the repository URL. A name taken
+ * from the URL is only good until the next call.
*/
extern const char *cgit_snapshot_prefix(const struct cgit_repo *repo);