1
0
Fork 0
mirror of https://github.com/tailix/libkernaux.git synced 2024-11-13 11:04:27 -05:00

Protect from segfault

This commit is contained in:
Alex Kotov 2022-12-04 01:26:58 +04:00
parent eae451ee75
commit 1395896538
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08

View file

@ -65,6 +65,8 @@ const void *KernAux_StackTrace_Frame_get_ptr(
) { ) {
KERNAUX_ASSERT(frame); KERNAUX_ASSERT(frame);
if (!frame->cur_ptr) return NULL;
#if defined(ASM_X86) #if defined(ASM_X86)
const size_t *const cur_ptr = frame->cur_ptr; const size_t *const cur_ptr = frame->cur_ptr;
return (const void*)cur_ptr[1]; return (const void*)cur_ptr[1];