fixes crash on servers with invalid packet (#5289)

This commit is contained in:
Alexandru Ionut Tripon 2026-04-01 10:24:39 +00:00 committed by GitHub
commit a4c9e294da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -62,7 +62,11 @@ void McClient::readRawResponse()
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(); parseResponse();
} catch (const Exception& e) {
emitFail(e.cause());
}
m_responseReadState = 2; m_responseReadState = 2;
} }
} }