[compiler-rt] 005eee8 - [GWP-ASan] Fix uninitialized memory use in sigaction.

Mitch Phillips via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 27 05:53:40 PDT 2020


Author: Mitch Phillips
Date: 2020-07-27T05:53:27-07:00
New Revision: 005eee8b3ef7f244daf12f574a191079bfc1918b

URL: https://github.com/llvm/llvm-project/commit/005eee8b3ef7f244daf12f574a191079bfc1918b
DIFF: https://github.com/llvm/llvm-project/commit/005eee8b3ef7f244daf12f574a191079bfc1918b.diff

LOG: [GWP-ASan] Fix uninitialized memory use in sigaction.

Fix up a small bug where we used a partially-uninitialized sigaction
struct in the optional signal handler. Shouldn't be a user-visible
change.

Added: 
    

Modified: 
    compiler-rt/lib/gwp_asan/optional/segv_handler_posix.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/gwp_asan/optional/segv_handler_posix.cpp b/compiler-rt/lib/gwp_asan/optional/segv_handler_posix.cpp
index 1bd7a606c213..9a80436efb31 100644
--- a/compiler-rt/lib/gwp_asan/optional/segv_handler_posix.cpp
+++ b/compiler-rt/lib/gwp_asan/optional/segv_handler_posix.cpp
@@ -144,7 +144,7 @@ void installSignalHandlers(gwp_asan::GuardedPoolAllocator *GPA, Printf_t Printf,
   PrintBacktraceForSignalHandler = PrintBacktrace;
   BacktraceForSignalHandler = SegvBacktrace;
 
-  struct sigaction Action;
+  struct sigaction Action = {};
   Action.sa_sigaction = sigSegvHandler;
   Action.sa_flags = SA_SIGINFO;
   sigaction(SIGSEGV, &Action, &PreviousHandler);


        


More information about the llvm-commits mailing list