pkg/storage/utils/localfs: fix strconv.Atoi overflow on 32-bit platforms - #5751
pkg/storage/utils/localfs: fix strconv.Atoi overflow on 32-bit platforms#5751Eiji-Kondo wants to merge 1 commit into
Conversation
|
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
|
Hi @Eiji-Kondo , Thanks for reporting this issue and good that you found a fix! We've never tried running on a 32-bit platform. Could you please:
Thanks! |
903fe2e to
7a7e853
Compare
|
Hi @jessegeens "Done! I've squashed the commits and removed the autoformatter changes. Thanks!"
|
7a7e853 to
7af3dd5
Compare
7af3dd5 to
b261331
Compare
|
Hi there, it appears there are still quite a few formatting artifacts, could you please remove them? Thanks! |
8cfc566 to
b261331
Compare
|
Sorry for the confusion! I have successfully reset the branch back to the previous clean state (b261331) to completely remove all formatting artifacts. It is now back to a single clean commit with only 2 files changed. Thanks! |
[Operating Environment]
CPU: Armv7 32-bit
OS: Debian Bookworm
Build: Cross-compiled for 32-bit Armv7 using Go
[Issue]
When running ListRevisions and convertToRecycleItem using reva-cli, no output was displayed.In short, the results are being silently excluded from the output.
[Suspected Cause]
In a 32-bit environment (Armv7), a 13-digit millisecond timestamp causes an overflow error.strconv.Atoi was being used in pkg/storage/utils/localfs/localfs.go.The int type in Go is platform-dependent (32-bit in a 32-bit environment). Since strconv.Atoi internally calls ParseInt(s, 10, 0), it likely overflowed due to the large value.
[Proposed Fix]
Replaced strconv.Atoi with strconv.ParseInt(..., 10, 64).