Closed
Bug 11332
Opened 27 years ago
Closed 21 years ago
Base64 encoding of byte streams with 8-bit values
Categories
(Grendel Graveyard :: Protocols, defect, P3)
Grendel Graveyard
Protocols
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: harning, Assigned: rjkeller)
References
()
Details
There seems to be a problem with the Base64 Encoder, when encoding other that
7-bit streems.
MimeBase64Encoder.java reads
98 if (buf_bytes == 0)
99 buf = (buf & 0x00FFFF) | (inb[i] << 16);
100 else if (buf_bytes == 1)
101 buf = (buf & 0xFF00FF) | (inb[i] << 8);
102 else
103 buf = (buf & 0xFFFF00) | (inb[i]);
but should read
98 if (buf_bytes == 0)
99 buf = (buf & 0x00FFFF) | (inb[i] << 16);
100 else if (buf_bytes == 1)
101 buf = (buf & 0xFF00FF) | ((in[i] << 8) & 0x00FF00);
102 else
103 buf = (buf & 0xFFFF00) | ((in[i]) & 0x0000FF);
the reason beeing that when shifting a negative value (eg. -122=10000110b) 8
positions left the result becomes 1111111110000110b and not 1000011000000000b
the original code assumes.
Correction:
the reason beeing that when shifting a negative value (eg. -122=10000110b) 8
positions left the result becomes 111111111000011000000000b and not
1000011000000000b the original code assumes.
Followup from submitter:
Fine ... I forgot one thing though:
46 (byte)'w', (byte)'x', (byte)'y', (byte)'z', (byte)'', (byte)'1',
(byte)'2', (byte)'3',
(byte)'z', (byte)'', (byte)'1'
should read
(byte)'z', (byte)'0', (byte)'1'
Comment 5•26 years ago
|
||
Cleared the resolution. (Bugzilla no longer supports the idea that an open bug
can have any kind of resolution set.)
Resolution: FIXED → ---
Comment 6•25 years ago
|
||
This bug has not been touched for more than nine months. In most cases, that
means it has "slipped through the net". Please could the owner take a moment to
add a comment to the bug with current status, and/or close it.
Thank you :-)
Gerv
Reassigning to nobody@mozilla.org as I'm not working on Grendel anymore.
Assignee: edwin → nobody
Status: REOPENED → NEW
| Assignee | ||
Comment 8•21 years ago
|
||
Moving to default owners
Assignee: nobody → rj.keller
QA Contact: talisman
| Assignee | ||
Comment 9•21 years ago
|
||
Just confirmed that issue described in comment #3 and description no longer
exist. Looks like edwin checked in the fix and forgot to resolve the bug.
--> FIXED
Status: NEW → RESOLVED
Closed: 27 years ago → 21 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•