This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Fix a use-after-free
ClosedPublic

Authored by kadircet on Mar 25 2021, 3:09 AM.

Details

Summary

Clangd was storing reference to a possibly-dead string in compiled
config. This patch fixes the issue by copying suppression strings from
fragments into compiled Config.

Fixes https://github.com/clangd/clangd/issues/724.

Diff Detail

Event Timeline

kadircet created this revision.Mar 25 2021, 3:09 AM
kadircet requested review of this revision.Mar 25 2021, 3:09 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 25 2021, 3:09 AM
njames93 added inline comments.
clang-tools-extra/clangd/ConfigCompile.cpp
385–386

While were here, worth while to move Normalized into the lambda.

sammccall accepted this revision.Mar 25 2021, 8:08 AM
This revision is now accepted and ready to land.Mar 25 2021, 8:08 AM
This revision was automatically updated to reflect the committed changes.
kadircet marked an inline comment as done.