소스 검색

#3461 fix security issue of REAMDE path in create repository

Unknwon 8 년 전
부모
커밋
cc647ba9d5
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      models/repo.go

+ 1 - 1
models/repo.go

@@ -870,7 +870,7 @@ type CreateRepoOptions struct {
 }
 
 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.
 	customPath := path.Join(setting.CustomPath, relPath)