Fix integer overflow on 32-bit systems when testing free space for wr…#36759
Fix integer overflow on 32-bit systems when testing free space for wr…#36759szaimen merged 1 commit intonextcloud:masterfrom
Conversation
|
cc @come-nc since you have a bit experience with 32-bit: what would be the best approach to fix this? Is checking against float even possible? |
|
Just ran into the same issue on beta 4 upgrade. Removing |
Psalm complains without... |
|
You mean if not both are int or both are float? Then we need to cast both to float before comparing (as on 64-bit free space will usually be int?), doing the same in all other cases where numerical values are compared which can be >2 GiB. How was such done before the temporary decision to drop 32-bit support? |
come-nc
left a comment
There was a problem hiding this comment.
I’m not even sure why a cast is needed, what does psalm complains about without it?
…iting a config file.
|
Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22 |
|
Still not sure why we cast the config file size to float now? |
…iting a config file.
Summary
This trivial commit fixes integer overflow on 32-bit systems when trying to write back config.php on upgrade.
The bug is introduced recently, in commit 9b6e5c6