Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix crash in comment parsing (fixes #1616)#1890

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

simon-paris
Copy link

This fixes a crash in parsing sequences of comments like the following:

///**/

The conditions to trigger the crash are:

  1. alternateCommentMode is set to true
  2. A single line comment is immediately followed by a block comment
  3. The block comment spans at least two lines

The crash happens becauseisDoubleSlashCommentLine returns true for lines starting with/*. It only checks for one slash because in the first callsite,offset points to the second slash character and the character before it is guaranteed to also be a slash. But this is not true in the second callsite. The result is that it treats the line with/* as a single line comment.

@alexander-fensteralexander-fenster merged commiteaf9f0a intoprotobufjs:masterAug 21, 2023
@alexander-fenster
Copy link
Contributor

Thank you!

@github-actionsgithub-actionsbot mentioned this pull requestAug 21, 2023
@simon-parissimon-paris deleted the fix-comment-parsing branchApril 12, 2024 08:06
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@alexander-fensteralexander-fensteralexander-fenster approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@simon-paris@alexander-fenster

[8]ページ先頭

©2009-2025 Movatter.jp