[PATCH] D44328: Support embedding natvis files in PDBs.

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 9 14:42:27 PST 2018


addNamedStream takes ownership by making a copy, although I could perhaps
make this more explicit by making the function accept a std::string
On Fri, Mar 9, 2018 at 2:26 PM Reid Kleckner via Phabricator <
reviews at reviews.llvm.org> wrote:

> rnk requested changes to this revision.
> rnk added inline comments.
> This revision now requires changes to proceed.
>
>
> ================
> Comment at: lld/COFF/PDB.cpp:984
> +    std::string StreamName = (Twine("/src/files/") + File).str();
> +    ExitOnErr(Builder.addNamedStream(StreamName,
> NatvisData->getBuffer()));
> +  }
> ----------------
> Hm, won't this make a UAF? The file is allocated here, we pass in a
> stringref, and nobody keeps the file mapping alive.
>
>
> https://reviews.llvm.org/D44328
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180309/f9efdd94/attachment.html>


More information about the llvm-commits mailing list