THRIFT-4862 C++ TBinaryProtocol crashes on port scan

Client: cpp
Patch: Michael Patrick

This closes #1939
This commit is contained in:
Jens Geyer 2019-11-19 21:43:45 +01:00
parent 528a0f0731
commit 225646b554

View File

@ -492,7 +492,11 @@ void TNonblockingServer::TConnection::workSocket() {
case SOCKET_RECV:
// It is an error to be in this state if we already have all the data
assert(readBufferPos_ < readWant_);
if (!(readBufferPos_ < readWant_)) {
GlobalOutput.printf("TNonblockingServer: frame size too short");
close();
return;
}
try {
// Read from the socket