Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions connection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ int QubicConnection::receiveData(uint8_t* buffer, int sz)

int QubicConnection::receiveAllDataOrThrowException(uint8_t* buffer, int sz)
{
if (sz < 0 || sz > (int)sizeof(mBuffer)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there should be a more appropriate place for this check because the checked mBuffer is not used in the code.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then it should be 0xffffff, can mBuffer be removed btw?

throw std::logic_error("Invalid packet size.");
}
int recvSz = receiveData(buffer, sz);
if (recvSz != sz)
{
Expand Down
Loading