Changeset 217 in josm for src/org/openstreetmap


Ignore:
Timestamp:
2007-04-24T00:21:55+02:00 (18 years ago)
Author:
framm
Message:

Fixed BASE64 bug that would lead to exceptions on clear text lengths of 3n+2.
Patch provided by Sander Hoentjen.
Fixes http://lists.openstreetmap.org/pipermail/dev/2007-April/004090.html

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/org/openstreetmap/josm/tools/Base64.java

    r195 r217  
    1212            out.append(enc.charAt(buf.charAt(0)>>2));
    1313            out.append(enc.charAt((buf.charAt(0) & 0x03) << 4 | (l==1?0:(buf.charAt(1) & 0xf0) >> 4)));
    14             out.append(l>1?enc.charAt((buf.charAt(1) & 0x0f) << 2 | (buf.charAt(2) & 0xc0) >> 6):'=');
     14            out.append(l>1?enc.charAt((buf.charAt(1) & 0x0f) << 2 | (l==2?0:(buf.charAt(2) & 0xc0) >> 6)):'=');
    1515            out.append(l>2?enc.charAt(buf.charAt(2) & 0x3f):'=');
    1616                }
Note: See TracChangeset for help on using the changeset viewer.