fix: potential file inclusion via variable

This commit is contained in:
lilong.129
2025-04-28 19:59:21 +08:00
parent 4d7dc466f3
commit 427cc1dab2
6 changed files with 7 additions and 7 deletions

View File

@@ -119,7 +119,7 @@ func LoadCurlCase(path string) (*hrp.TestCaseDef, error) {
}
func readFileLines(path string) ([]string, error) {
file, err := os.Open(path)
file, err := os.OpenFile(path, os.O_RDONLY, 0o666)
if err != nil {
log.Error().Err(err).Str("path", path).Msg("open file failed")
return nil, err