Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Block control codes and truncate longer configuration text blocks #4436

Merged
merged 2 commits into from May 1, 2024

Conversation

JohnMcPMS
Copy link
Member

@JohnMcPMS JohnMcPMS commented May 1, 2024

Change

All control codes in the range [0x0, 0x20) and the DELETE control code 0x7F (with the exceptions of the tab, line feed, and carriage return characters) will result in an error from the YAML parser. An alternative solution is to convert them to their control pictures, but it was decided that it was best to fail at this time.

The configuration output for each unit during the "show" portion (used by almost all of the commands to display details about the file) will limit the amount of output allowed for any field that comes from an external source. Data from the file will present a warning that it was truncated just below its output. If anything is truncated, an overall "error" will be output as well.

Validation

New and old tests alike.

Microsoft Reviewers: Open in CodeFlow

@JohnMcPMS JohnMcPMS requested a review from a team as a code owner May 1, 2024 18:24
@JohnMcPMS JohnMcPMS merged commit 457f84b into microsoft:master May 1, 2024
8 checks passed
@JohnMcPMS JohnMcPMS deleted the no-control-codes branch May 1, 2024 21:47
JohnMcPMS added a commit to JohnMcPMS/winget-cli that referenced this pull request May 2, 2024
…crosoft#4436)

All control codes in the range [0x0, 0x20) and the DELETE control code
0x7F (with the exceptions of the tab, line feed, and carriage return
characters) will result in an error from the YAML parser. An alternative
solution is to convert them to their control pictures, but it was
decided that it was best to fail at this time.

The configuration output for each unit during the "show" portion (used
by almost all of the commands to display details about the file) will
limit the amount of output allowed for any field that comes from an
external source. Data from the file will present a warning that it was
truncated just below its output. If anything is truncated, an overall
"error" will be output as well.
JohnMcPMS added a commit that referenced this pull request May 2, 2024
This was referenced May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants