[libunwind] [libunwind] Remove unnecessary strcpy dependency (PR #72043)
Alexander Richardson via cfe-commits
cfe-commits at lists.llvm.org
Sat Nov 11 22:47:55 PST 2023
================
@@ -143,7 +143,7 @@ _Unwind_Backtrace(_Unwind_Trace_Fn callback, void *ref) {
// Create a mock exception object for force unwinding.
_Unwind_Exception ex;
memset(&ex, '\0', sizeof(ex));
- strcpy((char *)&ex.exception_class, "CLNGUNW");
+ memcpy(&ex.exception_class, "CLNGUNW", sizeof(ex.exception_class));
----------------
arichardson wrote:
Maybe use the string length here instead of the size of the exception class?
https://github.com/llvm/llvm-project/pull/72043
More information about the cfe-commits
mailing list