Single file archive base64 content length isn't being properly calculated in some cases
Categories
(Firefox :: Profile Backup, defect, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox129 | --- | fixed |
People
(Reporter: mconley, Assigned: mconley)
References
(Blocks 1 open bug)
Details
(Whiteboard: [fidefe-device-migration])
Attachments
(1 file)
After bug 1897498 landed, I tried to export the simple single-file archive with my main profile. This worked properly, but when attempting to extract the ZIP file, the extraction routine choked on the base64 bytes being pulled in. When I debugged this, it looks like what's going on is that the base64 string being decoded is being truncated a bit - and this is likely because we computed an incorrect content length for the base64 bytes.
This bug is for getting that fixed and a proper test written for this case.
Updated•14 days ago
|
Assignee | ||
Comment 1•14 days ago
|
||
I found the bug. We're erroneously assuming that the number of base64 encoded bytes for some bytes X is equal to the sum of the base64 encoded bytes for some bytes X / N, where N is some chunk size.
When bytes are divided like this into chunks, if the chunk is not a multiple of 6, base64 encoding will add some padding. We need to take that individual chunk padding into account.
Assignee | ||
Comment 2•14 days ago
|
||
Updated•14 days ago
|
Pushed by mconley@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/45f7948e5eeb Fix a math error in calculating binary blob content length when it divides evenly by chunk size. r=backup-reviewers,fchasen
Description
•