summaryrefslogtreecommitdiff
path: root/git-web--browse.sh
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2015-09-24 17:07:45 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2015-10-05 11:08:04 -0700
commite9ba678175da28607d57043e1363c6252880dd7f (patch)
tree8065c32ce9b8ae20d361f1e20f59067dad64e60a /git-web--browse.sh
parentmerge-recursive: convert malloc / strcpy to strbuf (diff)
downloadtgif-e9ba678175da28607d57043e1363c6252880dd7f.tar.xz
enter_repo: convert fixed-size buffers to strbufs
We use two PATH_MAX-sized buffers to represent the repo path, and must make sure not to overflow them. We do take care to check the lengths, but the logic is rather hard to follow, as we use several magic numbers (e.g., "PATH_MAX - 10"). And in fact you _can_ overflow the buffer if you have a ".git" file with an extremely long path in it. By switching to strbufs, these problems all go away. We do, however, retain the check that the initial input we get is no larger than PATH_MAX. This function is an entry point for untrusted repo names from the network, and it's a good idea to keep a sanity check (both to avoid allocating arbitrary amounts of memory, and also as a layer of defense against any downstream users of the names). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-web--browse.sh')
0 files changed, 0 insertions, 0 deletions