Merge pull request #814 from sebastian-carpenter/GH-issue-813

rearranged evaluation of unsigned condition
pull/816/head
John Safranek 2025-07-08 14:30:26 -07:00 committed by GitHub
commit 1828eeaf8e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -3227,7 +3227,7 @@ int wolfSSH_SendPacket(WOLFSSH* ssh)
return WS_SOCKET_ERROR_E;
}
while (ssh->outputBuffer.length - ssh->outputBuffer.idx > 0) {
while (ssh->outputBuffer.length > ssh->outputBuffer.idx) {
int sent;
/* sanity check on amount requested to be sent */
@ -3237,7 +3237,7 @@ int wolfSSH_SendPacket(WOLFSSH* ssh)
return WS_BUFFER_E;
}
sent = ssh->ctx->ioSendCb(ssh,
sent = ssh->ctx->ioSendCb(ssh,
ssh->outputBuffer.buffer + ssh->outputBuffer.idx,
ssh->outputBuffer.length - ssh->outputBuffer.idx,
ssh->ioWriteCtx);
@ -10002,7 +10002,7 @@ int DoReceive(WOLFSSH* ssh)
}
if (!aeadMode) {
if (ssh->curSz + UINT32_SZ - peerBlockSz > 0) {
if (ssh->curSz + UINT32_SZ > peerBlockSz) {
ret = Decrypt(ssh,
ssh->inputBuffer.buffer + ssh->inputBuffer.idx
+ peerBlockSz,