Skip to content

Commit d5adc24

Browse files
[libunwind] Remove unnecessary strcpy dependency
1 parent aebd232 commit d5adc24

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

libunwind/src/UnwindLevel1-gcc-ext.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ _Unwind_Backtrace(_Unwind_Trace_Fn callback, void *ref) {
143143
// Create a mock exception object for force unwinding.
144144
_Unwind_Exception ex;
145145
memset(&ex, '\0', sizeof(ex));
146-
strcpy((char *)&ex.exception_class, "CLNGUNW");
146+
memcpy(&ex.exception_class, "CLNGUNW", sizeof(ex.exception_class));
147147
#endif
148148

149149
// walk each frame

libunwind/test/forceunwind.pass.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ __attribute__((noinline)) void foo() {
6161
#if defined(_LIBUNWIND_ARM_EHABI)
6262
// Create a mock exception object.
6363
memset(e, '\0', sizeof(*e));
64-
strcpy(reinterpret_cast<char *>(&e->exception_class), "CLNGUNW");
64+
memcpy(&e->exception_class, "CLNGUNW", sizeof(e->exception_class));
6565
#endif
6666
_Unwind_ForcedUnwind(e, stop, (void *)&foo);
6767
}

0 commit comments

Comments
 (0)