0
0
Fork 0
mirror of https://github.com/go-gitea/gitea synced 2024-11-18 07:52:03 +01:00

#3461 fix security issue of REAMDE path in create repository

This commit is contained in:
Unknwon 2016-08-15 02:35:54 -07:00
parent 5e89485cec
commit cc647ba9d5

View file

@ -870,7 +870,7 @@ type CreateRepoOptions struct {
} }
func getRepoInitFile(tp, name string) ([]byte, error) { func getRepoInitFile(tp, name string) ([]byte, error) {
relPath := path.Join("conf", tp, name) relPath := path.Join("conf", tp, strings.TrimLeft(name, "./"))
// Use custom file when available. // Use custom file when available.
customPath := path.Join(setting.CustomPath, relPath) customPath := path.Join(setting.CustomPath, relPath)