Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixup #735

Merged
merged 1 commit into from
Aug 16, 2024
Merged

Fixup #735

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
19 changes: 13 additions & 6 deletions src/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -3046,14 +3046,17 @@ static int GetInputText(WOLFSSH* ssh, byte** pEol)
in = ReceiveData(ssh,
ssh->inputBuffer.buffer + ssh->inputBuffer.length, inSz);

if (in == -1)
if (in == -1) {
return WS_SOCKET_ERROR_E;
}

if (in == WS_WANT_READ)
if (in == WS_WANT_READ) {
return WS_WANT_READ;
}

if (in > inSz)
if (in > inSz) {
return WS_RECV_OVERFLOW_E;
}

ssh->inputBuffer.length += in;
inSz -= in;
Expand All @@ -3077,7 +3080,11 @@ static int GetInputText(WOLFSSH* ssh, byte** pEol)
if (pEol)
*pEol = (byte*)eol;

return (gotLine ? WS_SUCCESS : WS_VERSION_E);
if (!gotLine) {
return WS_VERSION_E;
}

return WS_SUCCESS;
}


Expand Down Expand Up @@ -3191,7 +3198,7 @@ static int GetInputData(WOLFSSH* ssh, word32 size)
}
else {
/* all other unexpected negative values is a failure case */
ssh->error = WS_FATAL_ERROR;
ssh->error = WS_SOCKET_ERROR_E;
return WS_FATAL_ERROR;
}

Expand Down Expand Up @@ -3852,7 +3859,7 @@ static int DoKexInit(WOLFSSH* ssh, byte* buf, word32 len, word32* idx)
word32 listSz;
word32 cannedListSz;
word32 cannedAlgoNamesSz;
word32 skipSz;
word32 skipSz = 0;
word32 begin;

WLOG(WS_LOG_DEBUG, "Entering DoKexInit()");
Expand Down
Loading