fixes crash on servers with invalid packet

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2026-04-01 11:28:10 +03:00
parent 1450ffca18
commit 0689e58ca2

View file

@ -60,9 +60,13 @@ void McClient::readRawResponse()
if (m_responseReadState == 1 && 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 "
<< m_resp.size() << " received)";
<< m_resp.size() << " received)";
}
try {
parseResponse();
} catch (const Exception& e) {
emitFail(e.cause());
}
parseResponse();
m_responseReadState = 2;
}
}