mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2026-06-29 01:54:20 +03:00
fixes crash on servers with invalid packet (#5289)
This commit is contained in:
commit
a4c9e294da
1 changed files with 6 additions and 2 deletions
|
|
@ -60,9 +60,13 @@ void McClient::readRawResponse()
|
||||||
if (m_responseReadState == 1 && m_resp.size() >= m_wantedRespLength) {
|
if (m_responseReadState == 1 && m_resp.size() >= m_wantedRespLength) {
|
||||||
if (m_resp.size() > m_wantedRespLength) {
|
if (m_resp.size() > m_wantedRespLength) {
|
||||||
qDebug().nospace() << "Warning: Packet length doesn't match actual packet size (" << m_wantedRespLength << " expected vs "
|
qDebug().nospace() << "Warning: Packet length doesn't match actual packet size (" << m_wantedRespLength << " expected vs "
|
||||||
<< m_resp.size() << " received)";
|
<< m_resp.size() << " received)";
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
parseResponse();
|
||||||
|
} catch (const Exception& e) {
|
||||||
|
emitFail(e.cause());
|
||||||
}
|
}
|
||||||
parseResponse();
|
|
||||||
m_responseReadState = 2;
|
m_responseReadState = 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue