Skip to content

wolfSSH_SFTP_SendReadPacket does not discard remaining data on request ID mismatc #838

@LIYAOHAN

Description

@LIYAOHAN

Problem Description:

In the function wolfSSH_SFTP_SendReadPacket, when state->reqId != ssh->reqId is true (i.e., the request ID in the response does not match the expected request ID), the function only returns WS_FATAL_ERROR without clearing or discarding the remaining data in the response buffer. This may cause subsequent SFTP operations to parse the wrong data, leading to protocol desynchronization or errors.

Suggested Fix:

When detecting a request ID mismatch, the function should read and discard the remaining data of the current response to ensure the stream stays in sync, before returning the error.

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