Fix f_518, f_519, f_871, f_1270#899
Open
yosuke-wolfssl wants to merge 4 commits intowolfSSL:masterfrom
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses several correctness issues across the Windows terminal handling, Windows filesystem porting layer, and internal packet/key parsing code.
Changes:
- Fix Windows console foreground color masking for ANSI attribute case
30(black foreground). - Harden Windows
WS_FindFirstFileA()by usingINVALID_HANDLE_VALUEand guarding output conversion/attribute access on failure. - Improve public key blob parsing bounds-safety by using
GetSkip()in RSA/ECC public key parsing; adjust channel failure length validation.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/wolfterm.c |
Corrects the bitmask used when clearing the foreground color bits for attribute 30. |
src/port.c |
Uses INVALID_HANDLE_VALUE consistently and avoids reading/converting findFileData when FindFirstFileW() fails. |
src/internal.c |
Uses GetSkip() to bounds-check skipping variable-length fields in RSA/ECC pubkey parsing; updates DoChannelFailure() length check (but currently introduces a parsing-consumption issue). |
Comments suppressed due to low confidence (1)
src/internal.c:9409
- After changing the length validation to allow non-zero payloads, this handler still doesn't consume or validate the expected fields of SSH_MSG_CHANNEL_FAILURE. The message payload should include at least the recipient channel ID (uint32), so leaving *idx unchanged will cause DoPacket() to not advance past the payload and corrupt subsequent packet parsing. Please parse/validate the recipient channel ID (and set/advance *idx accordingly), or at minimum advance *idx by len once the payload is accepted (and ideally reject unexpected lengths).
if (ssh == NULL || buf == NULL || len == 0 || idx == NULL)
ret = WS_BAD_ARGUMENT;
if (ret == WS_SUCCESS)
ret = WS_CHANOPEN_FAILED;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR addresses f issues: