[clang] [Format] Do not crash on non-null terminated strings (PR #131299)

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 24 04:16:39 PDT 2025


ilya-biryukov wrote:

> Can you add a reproducer?

I'm not sure I can do better than the test I've added.
My colleague caught this by accidentally getting an assertion failure when using this API downstream.
The test illustrates how it got used and I'm not sure if `clang-format` binary or any other upstream tool currently crash with this. (`clang-format` itself is using a separate codepath entirely, other tools I checked always pass null-terminated strings).

https://github.com/llvm/llvm-project/pull/131299


More information about the cfe-commits mailing list