mirror of
https://github.com/intel/llvm.git
synced 2026-02-07 16:11:27 +08:00
[Symbolizer] Fix use-after-free
MarkupFilter keeps a reference to the last filtered StringRef. Just keep it alive a bit longer. Found by asan.
This commit is contained in:
@@ -368,7 +368,8 @@ static SmallVector<uint8_t> parseBuildIDArg(const opt::InputArgList &Args,
|
||||
// Symbolize markup from stdin and write the result to stdout.
|
||||
static void filterMarkup(const opt::InputArgList &Args) {
|
||||
MarkupFilter Filter(outs(), parseColorArg(Args));
|
||||
for (std::string InputString; std::getline(std::cin, InputString);) {
|
||||
std::string InputString;
|
||||
while (std::getline(std::cin, InputString)) {
|
||||
InputString += '\n';
|
||||
Filter.filter(InputString);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user