Fixes a stack overflow reported by James B. Byrne, investigated by Danny van Heumen.

This commit is contained in:
lubomir.marinov 2015-06-19 20:41:36 +00:00
parent 50e8ac2616
commit a4f7d4ff8d

View File

@ -316,13 +316,16 @@ public abstract class Candidate<T extends Candidate<?>>
} }
else else
{ {
baseEqualsCandidateBase = base.equals(candidateBase); // If this and candidate are bases of themselves, their bases are
// considered equal.
baseEqualsCandidateBase
= (base == this && candidateBase == candidate)
|| base.equals(candidateBase);
} }
//compare other properties //compare other properties
return return
(baseEqualsCandidateBase baseEqualsCandidateBase
|| (base == this && candidateBase == candidate))
&& getPriority() == candidate.getPriority() && getPriority() == candidate.getPriority()
&& getType() == candidate.getType() && getType() == candidate.getType()
&& getFoundation().equals(candidate.getFoundation()); && getFoundation().equals(candidate.getFoundation());
@ -995,4 +998,4 @@ public abstract class Candidate<T extends Candidate<?>>
{ {
this.tcpType = tcpType; this.tcpType = tcpType;
} }
} }