forked from I2P_Developers/i2p.i2p
BFNS: Trim whitespace from hosts.txt when importing
DataStructureImpl: Throw unique exception on bad base 64
This commit is contained in:
@@ -240,7 +240,7 @@ public class BlockfileNamingService extends DummyNamingService {
|
||||
if (line.length() < split + 1)
|
||||
continue;
|
||||
}
|
||||
String b64 = line.substring(split+1); //.trim() ??????????????
|
||||
String b64 = line.substring(split+1).trim();
|
||||
Destination d = lookupBase64(b64);
|
||||
if (d != null) {
|
||||
addEntry(rv, hostsfile, key, d, sourceMsg);
|
||||
|
@@ -37,6 +37,7 @@ public abstract class DataStructureImpl implements DataStructure, Serializable {
|
||||
public void fromBase64(String data) throws DataFormatException {
|
||||
if (data == null) throw new DataFormatException("Null data passed in");
|
||||
byte bytes[] = Base64.decode(data);
|
||||
if (bytes == null) throw new DataFormatException("Bad Base64 \"" + data + '"');
|
||||
fromByteArray(bytes);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user