mirror of
https://github.com/rclone/rclone.git
synced 2026-10-10 15:01:37 -04:00
rc: fix large numeric parameters being rejected on 32 bit builds
Params.GetInt64 parsed string parameters with strconv.ParseInt(x, 10, 0). A bitSize of 0 means int, which is 32 bits on 386, arm, mips and mipsle, so any value outside the int32 range was rejected as out of range even though it fits in the int64 the method returns. Parameters reach the rc API as strings on the paths that matter here: the rc server puts every URL query and form value into Params as a string, and rclone rc turns each key=value argument into a string. So on a 32 bit build operations/getfile could not be given an offset, count, head or tail beyond 2 GiB, and debug/set-soft-memory-limit could not be given a limit beyond 2 GiB, while the same commands worked on a 64 bit build. Parse with a bitSize of 64 to match the declared return type. This is the string half of the range checking that was added to the float64 branch of the same function in976d05e1. (cherry picked from commitb5f83bdbf2)
This commit is contained in:
500 Internal Server Error
Gitea Version: 1.28.0+dev-477-g8b6ad49a5f