Skip to content

Commit

Permalink
RHINENG-12951: fix for CWE-23
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelMraka committed Sep 26, 2024
1 parent 8430122 commit b4463fa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion database_admin/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"database/sql"
"fmt"
"os"
"path/filepath"
"strconv"
"strings"

Expand Down Expand Up @@ -73,7 +74,7 @@ func MigrateUp(conn database.Driver, sourceURL string) {
func latestSchemaMigrationFileVersion(sourceURL string) (int, error) {
latestVer := 0
dir := sourceURL[len("file://"):]
files, err := os.ReadDir(dir)
files, err := os.ReadDir(filepath.Clean(dir))
if err != nil {
return 0, errors.Wrap(err, fmt.Sprintf("Error reading migration files %s in %s", files, dir))
}
Expand Down

0 comments on commit b4463fa

Please sign in to comment.