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.
-rw-r--r--source/ui-shared.c38
-rw-r--r--source/ui-shared.h3
-rwxr-xr-xtests/t0110-snapshot.sh30
3 files changed, 42 insertions, 29 deletions