Skip to content

Commit ad31c4f

Browse files
committed
vcsim: fix integer type conversion
replace the use of strconv.Atoi with strconv.ParseInt, specifying the bit size as 32. This ensures that the parsed value is within the range of int32. Ref: GHSA https://github.com/vmware/govmomi/security/code-scanning/20 Signed-off-by: Ryan Johnson <[email protected]>
1 parent 4170c79 commit ad31c4f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

vcsim/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ func updateHostTemplate(ip string) error {
255255
}
256256
esx.HostSystem.Summary.ManagementServerIp = addr
257257
if port != "0" { // server starts after the model is created, skipping auto-selected ports for now
258-
n, err := strconv.Atoi(port)
258+
n, err := strconv.ParseInt(port, 10, 32)
259259
if err != nil {
260260
return err
261261
}

0 commit comments

Comments
 (0)