Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Commit

Permalink
Update int-parsing.md
Browse files Browse the repository at this point in the history
  • Loading branch information
disconnect3d committed Apr 1, 2019
1 parent 773a3be commit 1b98cdb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion notes/dominik.czarnota/int-parsing.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ TODO: analyze them

### Atoi converted to int32/int64

**Since `Atoi` returns an `int` - casting to `int64` is rather fine. Casting to `int32` may overflow and the cast is needed - but to be valid, they should rather use `strconv.ParseInt` with `bits=32`.**

There are places where they convert string to int and then convert it to appropriate type. The value itself may be overflowed and the error won't be detected in those cases.

In `src/kubernetes-1.13.4/pkg/cloudprovider/providers/aws/aws.go:3169`:
Expand Down Expand Up @@ -506,4 +508,4 @@ func (s *SecureServingInfo) HostPort() (string, int, error) {
}
return host, port, nil
}
```
```

0 comments on commit 1b98cdb

Please sign in to comment.