[lldb][test] LogTest: Fix stack overflow
authorMichael Buch <michaelbuch12@gmail.com>
Thu, 8 Jun 2023 15:58:58 +0000 (16:58 +0100)
committerMichael Buch <michaelbuch12@gmail.com>
Thu, 8 Jun 2023 16:10:32 +0000 (17:10 +0100)
The expected function name requires 18 bytes of storage.

Caught by the public ASAN buildbot

Differential Revision: https://reviews.llvm.org/D152454

lldb/unittests/Utility/LogTest.cpp

index d3c878d3ea718fc17dfca071acfc090368a39f0e..1dac19486a8f7f5b12f873015e55898c69b2009c 100644 (file)
@@ -309,7 +309,7 @@ TEST_F(LogChannelEnabledTest, log_options) {
                               Err));
     llvm::StringRef Msg = logAndTakeOutputf("Hello World");
     char File[12];
-    char Function[17];
+    char Function[18];
 
     sscanf(Msg.str().c_str(),
            "%[^:]:%s                                 Hello World", File,