Skip to content

DoReiceive() does not update the input buffer after DoPacket(), when it has to. #621

@falemagn

Description

@falemagn

In internal.c, DoPacket() updates the input buffer's index unless WS_OVERFLOW_E or WS_BUFFER_E are returned:

ssh->inputBuffer.idx = idx;

DoReceive() should consequently update its part of the input buffer's size - the mac size - in all the cases in which DoPacket() updates the buffer's index too. But because it returns early in the cases in which DoPacket() returns certain errors, even though DoPacket() does update the buffer in those cases, it happens that the buffer gets misaligned.

In certain situations not easy to reproduce, this can lead to WS_OVERFLOW_E being returned or even crashes.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions