Skip to content

Commit 5727c91

Browse files
committed
C++: Escape any $ - specifically in $@ - coming from error messages
1 parent 7904db0 commit 5727c91

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

cpp/ql/src/Diagnostics/ExtractionWarnings.ql

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ where
1414
or
1515
warning instanceof ExtractionUnknownProblem
1616
select warning,
17-
"Extraction failed in " + warning.getFile() + " with warning " + warning.getProblemMessage(),
18-
warning.getSeverity()
17+
"Extraction failed in " + warning.getFile() + " with warning " +
18+
warning.getProblemMessage().replaceAll("$", "$$"), warning.getSeverity()

cpp/ql/src/Diagnostics/Internal/ExtractionErrors.ql

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ from ExtractionError error
1717
where
1818
error instanceof ExtractionUnknownError or
1919
exists(error.getFile().getRelativePath())
20-
select error, "Extraction failed in " + error.getFile() + " with error " + error.getErrorMessage(),
21-
error.getSeverity()
20+
select error,
21+
"Extraction failed in " + error.getFile() + " with error " +
22+
error.getErrorMessage().replaceAll("$", "$$"), error.getSeverity()

0 commit comments

Comments
 (0)