summaryrefslogtreecommitdiff
path: root/vector.h
diff options
context:
space:
mode:
authorJohn Keeping <john@keeping.me.uk>2013-04-01 19:03:34 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2013-04-08 15:59:46 +0200
commitb1f17f168b91d709c0c0e62608de301a36f06da9 (patch)
tree9aff1fe903087cb5016ab2afdb32a7ca1cc139b2 /vector.h
parent4b4a62d507adc61e20e75e2748301ef307a6c95f (diff)
downloadcgit-b1f17f168b91d709c0c0e62608de301a36f06da9.tar.gz
cgit-b1f17f168b91d709c0c0e62608de301a36f06da9.tar.bz2
cgit-b1f17f168b91d709c0c0e62608de301a36f06da9.zip
Fix out-of-bounds memory accesses with virtual_root=""
The CGit configuration variable virtual_root is normalized so that it does not have a trailing '/' character, but it is allowed to be empty (the empty string and NULL have different meanings here) and there is code that is insufficiently cautious when checking if it ends in a '/': if (virtual_root[strlen(virtual_root) - 1] != '/') Clearly this check is redundant, but rather than simply removing it we get a slight efficiency improvement by switching the normalization so that the virtual_root variable always ends in '/'. Do this with a new "ensure_end" helper. Signed-off-by: John Keeping <john@keeping.me.uk>
Diffstat (limited to 'vector.h')
0 files changed, 0 insertions, 0 deletions
lspan='5' class='logmsg'> 2016-08-19CleanupRené 'Necoro' Neumann25-703/+0 2016-07-09Add dev-python/pdb-cloneRené 'Necoro' Neumann2-0/+24 2016-07-06Fix r/dependRené 'Necoro' Neumann1-4/+4 2016-07-06Fix r/dependRené 'Necoro' Neumann4-3/+8 2016-07-06Crypt::LERené 'Necoro' Neumann8-0/+97 2016-07-03Python 3.4 support for flask-migrateRené 'Necoro' Neumann2-0/+35 2016-06-26Remove outdated radicaleRené 'Necoro' Neumann5-188/+0 2016-03-25feed2imap: ruby-2.1René 'Necoro' Neumann1-1/+1 2016-03-25i3 with pango but w/o cairoRené 'Necoro' Neumann4-0/+341 2016-02-21Use virtual/udevRené 'Necoro' Neumann1-1/+1 2016-01-09passRené 'Necoro' Neumann2-0/+84