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

fix(sanitizer): treat correct U+FFFD as normal character #128

Merged
merged 2 commits into from
Aug 11, 2023
Merged

fix(sanitizer): treat correct U+FFFD as normal character #128

merged 2 commits into from
Aug 11, 2023

Conversation

yin1999
Copy link
Contributor

@yin1999 yin1999 commented Aug 11, 2023

Fixes: #127.

As the length of src is larger than 1, so the utf8.DecodeRune() will not return (RuneError, 0), we can just check the following case: (RuneError, 1) to judge if there is a decode error.

Copy link
Contributor

@samcoe samcoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for getting started on this fix, I left one comment that I would like to see addressed.

Co-authored-by: Sam Coe <samcoe@users.noreply.github.com>
@yin1999 yin1999 requested a review from samcoe August 11, 2023 17:10
@yin1999
Copy link
Contributor Author

yin1999 commented Aug 11, 2023

Thanks for getting started on this fix, I left one comment that I would like to see addressed.

Thanks for the suggestion. I've applied this :)

@samcoe samcoe enabled auto-merge (squash) August 11, 2023 19:36
@samcoe samcoe merged commit 3d89f8c into cli:trunk Aug 11, 2023
@yin1999 yin1999 deleted the fix-decode-error branch August 11, 2023 22:51
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.

asciisanitizer.Sanitizer mishandled the unicode character
2 participants