mirror of
https://github.com/rclone/rclone.git
synced 2024-11-07 17:14:44 +01:00
onedrive: fix quickxorhash on 32 bit architectures
Before this fix quickxorhash would sometimes crash with an error like this: panic: runtime error: slice bounds out of range [-1248:] This was caused by an incorrect cast of a 64 bit number to a 32 bit one on 32 bit platforms. See: https://forum.rclone.org/t/panic-runtime-error-slice-bounds-out-of-range/37548
This commit is contained in:
parent
5f6b105c3e
commit
451f4c2a8f
@ -61,7 +61,7 @@ func New() hash.Hash {
|
||||
func (q *quickXorHash) Write(p []byte) (n int, err error) {
|
||||
var i int
|
||||
// fill last remain
|
||||
lastRemain := int(q.size) % dataSize
|
||||
lastRemain := q.size % dataSize
|
||||
if lastRemain != 0 {
|
||||
i += xorBytes(q.data[lastRemain:], p)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user