mirror of https://github.com/wolfSSL/wolfssh.git
commit
e1f242f451
|
@ -3875,8 +3875,11 @@ static int DoPacket(WOLFSSH* ssh)
|
||||||
msg = buf[idx++];
|
msg = buf[idx++];
|
||||||
/* At this point, payload starts at "buf + idx". */
|
/* At this point, payload starts at "buf + idx". */
|
||||||
|
|
||||||
/* sanity check on payloadSz */
|
/* sanity check on payloadSz. Uses "or" condition because of the case when
|
||||||
if (ssh->inputBuffer.bufferSz < payloadSz + idx) {
|
* adding idx to payloadSz causes it to overflow.
|
||||||
|
*/
|
||||||
|
if ((ssh->inputBuffer.bufferSz < payloadSz + idx) ||
|
||||||
|
(payloadSz + idx < payloadSz)) {
|
||||||
return WS_OVERFLOW_E;
|
return WS_OVERFLOW_E;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue