Skip to content

Commit 1828eea

Browse files
authored
Merge pull request wolfSSL#814 from sebastian-carpenter/GH-issue-813
rearranged evaluation of unsigned condition
2 parents b19ecb5 + ad07df0 commit 1828eea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/internal.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3227,7 +3227,7 @@ int wolfSSH_SendPacket(WOLFSSH* ssh)
32273227
return WS_SOCKET_ERROR_E;
32283228
}
32293229

3230-
while (ssh->outputBuffer.length - ssh->outputBuffer.idx > 0) {
3230+
while (ssh->outputBuffer.length > ssh->outputBuffer.idx) {
32313231
int sent;
32323232

32333233
/* sanity check on amount requested to be sent */
@@ -3237,7 +3237,7 @@ int wolfSSH_SendPacket(WOLFSSH* ssh)
32373237
return WS_BUFFER_E;
32383238
}
32393239

3240-
sent = ssh->ctx->ioSendCb(ssh,
3240+
sent = ssh->ctx->ioSendCb(ssh,
32413241
ssh->outputBuffer.buffer + ssh->outputBuffer.idx,
32423242
ssh->outputBuffer.length - ssh->outputBuffer.idx,
32433243
ssh->ioWriteCtx);
@@ -10002,7 +10002,7 @@ int DoReceive(WOLFSSH* ssh)
1000210002
}
1000310003

1000410004
if (!aeadMode) {
10005-
if (ssh->curSz + UINT32_SZ - peerBlockSz > 0) {
10005+
if (ssh->curSz + UINT32_SZ > peerBlockSz) {
1000610006
ret = Decrypt(ssh,
1000710007
ssh->inputBuffer.buffer + ssh->inputBuffer.idx
1000810008
+ peerBlockSz,

0 commit comments

Comments
 (0)