mirror of
https://github.com/rclone/rclone.git
synced 2026-10-03 03:05:38 -04:00
When the source supplied fewer bytes than its declared size, the compressed data file was stored under a name containing the declared size while the metadata recorded the actual number of bytes read. NewObject looks the data file up by the size in the metadata, so the resulting object could never be read again, and the upload reported success. Check that the number of bytes read matches the declared size after uploading the data and before writing the metadata, and remove the data file and return an error if it does not. This was found by the new FsPutShortEOF integration test.