1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-25 07:42:06 +01:00

Merge pull request #308 from adiaholic/SMACK-718

Prevent extremely long reply timeouts from being set.
This commit is contained in:
Florian Schmaus 2019-08-22 14:54:15 +02:00 committed by GitHub
commit c6b75d8bcc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1192,7 +1192,12 @@ public abstract class AbstractXMPPConnection implements XMPPConnection {
@Override
public void setReplyTimeout(long timeout) {
replyTimeout = timeout;
if (Long.MAX_VALUE - System.currentTimeMillis() < timeout) {
throw new IllegalArgumentException("Extremely long reply timeout");
}
else {
replyTimeout = timeout;
}
}
private SmackConfiguration.UnknownIqRequestReplyMode unknownIqRequestReplyMode = SmackConfiguration.getUnknownIqRequestReplyMode();