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

C++: Escape any $ - specifically in $@ - coming from error messages #19144

Merged
merged 2 commits into from
Mar 28, 2025

Conversation

jketema
Copy link
Contributor

@jketema jketema commented Mar 28, 2025

No description provided.

@Copilot Copilot bot review requested due to automatic review settings March 28, 2025 09:52
@jketema jketema requested a review from a team as a code owner March 28, 2025 09:52
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

Files not reviewed (2)
  • cpp/ql/src/Diagnostics/ExtractionWarnings.ql: Language not supported
  • cpp/ql/src/Diagnostics/Internal/ExtractionErrors.ql: Language not supported

Tip: Copilot code review supports C#, Go, Java, JavaScript, Markdown, Python, Ruby and TypeScript, with more languages coming soon. Learn more

@github-actions github-actions bot added the C++ label Mar 28, 2025
@jketema jketema added the no-change-note-required This PR does not need a change note label Mar 28, 2025
Copy link
Contributor

@redsun82 redsun82 left a comment

Choose a reason for hiding this comment

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

LGTM!

I wonder if we will see this giving us problems in other instances. Do we have other diagnostics printed out in queries that could cause similar problems?

getFile() could also very theoretically contain a $, but I guess having filenames with $ is fishing for problems 😅

@jketema
Copy link
Contributor Author

jketema commented Mar 28, 2025

I wonder if we will see this giving us problems in other instances. Do we have other diagnostics printed out in queries that could cause similar problems?

Possibly, but I don't see any other way of fixing this than on a case-by -case basis.

getFile() could also very theoretically contain a $, but I guess having filenames with $ is fishing for problems 😅

Yeah. The critically broken pattern is $@ though, because we use that as a placeholder in QL problem queries. Can that occur in file names?

@jketema jketema merged commit 86ecef6 into github:main Mar 28, 2025
14 checks passed
@jketema jketema deleted the dollar-escape branch March 28, 2025 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants