forked from I2P_Developers/i2p.i2p
NetDb: Fix NPE on store of Encrypted LS (ticket #2563)
This commit is contained in:
@ -944,8 +944,12 @@ public abstract class KademliaNetworkDatabaseFacade extends NetworkDatabaseFacad
|
|||||||
|
|
||||||
// spoof / hash collision detection
|
// spoof / hash collision detection
|
||||||
// todo allow non-exp to overwrite exp
|
// todo allow non-exp to overwrite exp
|
||||||
if (rv != null && !leaseSet.getDestination().equals(rv.getDestination()))
|
if (rv != null) {
|
||||||
throw new IllegalArgumentException("LS Hash collision");
|
Destination d1 = leaseSet.getDestination();
|
||||||
|
Destination d2 = rv.getDestination();
|
||||||
|
if (d1 != null && d2 != null && !d1.equals(d2))
|
||||||
|
throw new IllegalArgumentException("LS Hash collision");
|
||||||
|
}
|
||||||
|
|
||||||
EncryptedLeaseSet encls = null;
|
EncryptedLeaseSet encls = null;
|
||||||
if (leaseSet.getType() == DatabaseEntry.KEY_TYPE_ENCRYPTED_LS2) {
|
if (leaseSet.getType() == DatabaseEntry.KEY_TYPE_ENCRYPTED_LS2) {
|
||||||
|
Reference in New Issue
Block a user