Commit 9783b88
committed
Refactor: fix possible out-of-bounds read when reporting errors
vscode_error_formatter::append_diagnostic assumes that the error code
string_view is 0-terminated. It currently is 0-terminated, but this
relying on this is a bad idea.
Copy the error code into an std::string to force null termination. (We
were already creating a std::string anyway for other purposes.)
This commit should not change behavior.1 parent 0647263 commit 9783b88
1 file changed
+3
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
92 | 93 | | |
93 | | - | |
| 94 | + | |
94 | 95 | | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
99 | | - | |
| 100 | + | |
100 | 101 | | |
101 | 102 | | |
102 | 103 | | |
| |||
0 commit comments