[clang-tools-extra] r231421 - Use std::string instead of StringRef to prevent use-after-free.

Alexander Kornienko alexfh at google.com
Thu Mar 5 15:25:32 PST 2015


Thanks for the fix!
On 6 Mar 2015 00:22, "Daniel Jasper" <djasper at google.com> wrote:

> Author: djasper
> Date: Thu Mar  5 17:17:32 2015
> New Revision: 231421
>
> URL: http://llvm.org/viewvc/llvm-project?rev=231421&view=rev
> Log:
> Use std::string instead of StringRef to prevent use-after-free.
>
> Discovered by asan.
>
> Modified:
>
> clang-tools-extra/trunk/clang-tidy/readability/NamespaceCommentCheck.cpp
>
> Modified:
> clang-tools-extra/trunk/clang-tidy/readability/NamespaceCommentCheck.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/readability/NamespaceCommentCheck.cpp?rev=231421&r1=231420&r2=231421&view=diff
>
> ==============================================================================
> ---
> clang-tools-extra/trunk/clang-tidy/readability/NamespaceCommentCheck.cpp
> (original)
> +++
> clang-tools-extra/trunk/clang-tidy/readability/NamespaceCommentCheck.cpp
> Thu Mar  5 17:17:32 2015
> @@ -83,7 +83,7 @@ void NamespaceCommentCheck::check(const
>    bool NeedLineBreak = NextTokenIsOnSameLine && Tok.isNot(tok::eof);
>
>    SourceRange OldCommentRange(AfterRBrace, AfterRBrace);
> -  StringRef Message = "%0 not terminated with a closing comment";
> +  std::string Message = "%0 not terminated with a closing comment";
>
>    // Try to find existing namespace closing comment on the same line.
>    if (Tok.is(tok::comment) && NextTokenIsOnSameLine) {
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150306/2c807c51/attachment.html>


More information about the cfe-commits mailing list