Skip to content

pkg/storage/utils/localfs: fix strconv.Atoi overflow on 32-bit platforms - #5751

Open
Eiji-Kondo wants to merge 1 commit into
cs3org:masterfrom
Eiji-Kondo:fix/strconv-atoi-overflow
Open

pkg/storage/utils/localfs: fix strconv.Atoi overflow on 32-bit platforms#5751
Eiji-Kondo wants to merge 1 commit into
cs3org:masterfrom
Eiji-Kondo:fix/strconv-atoi-overflow

Conversation

@Eiji-Kondo

Copy link
Copy Markdown

[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).

@update-docs

update-docs Bot commented Aug 8, 2026

Copy link
Copy Markdown

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.

@jessegeens

Copy link
Copy Markdown
Contributor

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:

  • squash your commits?
  • remove the autoformatter changes?

Thanks!

@Eiji-Kondo
Eiji-Kondo force-pushed the fix/strconv-atoi-overflow branch 2 times, most recently from 903fe2e to 7a7e853 Compare August 18, 2026 16:11
@Eiji-Kondo

Copy link
Copy Markdown
Author

Hi @jessegeens

"Done! I've squashed the commits and removed the autoformatter changes. Thanks!"

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:

  • squash your commits?
  • remove the autoformatter changes?

Thanks!

@Eiji-Kondo
Eiji-Kondo force-pushed the fix/strconv-atoi-overflow branch from 7a7e853 to 7af3dd5 Compare August 18, 2026 16:33
@Eiji-Kondo
Eiji-Kondo force-pushed the fix/strconv-atoi-overflow branch from 7af3dd5 to b261331 Compare August 18, 2026 16:37
@glpatcern

Copy link
Copy Markdown
Member

Hi there, it appears there are still quite a few formatting artifacts, could you please remove them? Thanks!

@Eiji-Kondo
Eiji-Kondo force-pushed the fix/strconv-atoi-overflow branch from 8cfc566 to b261331 Compare August 30, 2026 14:48
@Eiji-Kondo

Copy link
Copy Markdown
Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants