syncthing/syncthing — pull request #797 by seehuhn (2014-10-07 13:07:49+00:00)
Title: bug fix: allow folder names up to length 64 in leveldb

When extracting a folder name from the byte slices used as database
keys, bytes.IndexByte() is used to find and remove trailing 0 bytes.
In case the folder name is 64 bytes long, bytes.IndexByte() returns
-1. Before this change, syncthing crashed in this case with an
out-of-bounds slice access.

The commit fixes the problem and also introduces a test case which
checks for the presence of the bug.