summaryrefslogtreecommitdiff
path: root/builtin/show-branch.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2015-08-19 18:12:41 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-09-04 16:36:28 (GMT)
commitc29edfefb6f6a3fef80172c16bcc34c826d417b0 (patch)
tree8441a329d59f164aa75f5f3752c420e459a7048b /builtin/show-branch.c
parentf514ef9787f320287d7ba71f2965127b9d8b3832 (diff)
downloadgit-c29edfefb6f6a3fef80172c16bcc34c826d417b0.zip
git-c29edfefb6f6a3fef80172c16bcc34c826d417b0.tar.gz
git-c29edfefb6f6a3fef80172c16bcc34c826d417b0.tar.bz2
notes: use a strbuf in add_non_note
When we are loading a notes tree into our internal hash table, we also collect any files that are clearly non-notes. We format the name of the file into a PATH_MAX buffer, but unlike true notes (which cannot be larger than a fanned-out sha1 hash), these tree entries can be arbitrarily long, overflowing our buffer. We can fix this by switching to a strbuf. It doesn't even cost us an extra allocation, as we can simply hand ownership of the buffer over to the non-note struct. This is of moderate security interest, as you might fetch notes trees from an untrusted remote. However, we do not do so by default, so you would have to manually fetch into the notes namespace. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/show-branch.c')
0 files changed, 0 insertions, 0 deletions