Skip to content

Commit

Permalink
Address GH code scanning
Browse files Browse the repository at this point in the history
https://github.com/PeerDB-io/peerdb/security/code-scanning/3

GH doesn't like converting Itoa result to smaller integer
Ports are 16 bit unsigned integers, so parse as 16 bit unsigned integer
  • Loading branch information
serprex committed Dec 7, 2023
1 parent 1a1d5a7 commit c248e8c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion flow/e2e/sqlserver/sqlserver_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type SQLServerHelper struct {
}

func NewSQLServerHelper(name string) (*SQLServerHelper, error) {
port, err := strconv.Atoi(os.Getenv("SQLSERVER_PORT"))
port, err := strconv.ParseUint(os.Getenv("SQLSERVER_PORT"), 10, 16)
if err != nil {
return nil, fmt.Errorf("invalid SQLSERVER_PORT: %s", os.Getenv("SQLSERVER_PORT"))
}
Expand Down

0 comments on commit c248e8c

Please sign in to comment.