From 3b01d6620332a2e9824fe7aa87f7cb55efc22d74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Bastian?= Date: Sun, 9 Jun 2019 03:45:55 +0200 Subject: [PATCH] eh_elf: allow %rip to be NULL before end-of-chain check --- src/eh_elf/eh_elf.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/eh_elf/eh_elf.c b/src/eh_elf/eh_elf.c index 1c4e4087..245d2e84 100644 --- a/src/eh_elf/eh_elf.c +++ b/src/eh_elf/eh_elf.c @@ -156,8 +156,16 @@ int eh_elf_step_cursor(struct cursor *cursor) { return -3; } - if(eh_elf_context.rip < 10 || eh_elf_context.rsp < 10) + if(((eh_elf_context.flags & (1 << UNWF_RIP)) + && eh_elf_context.rip < 10) + || ((eh_elf_context.flags & (1 << UNWF_RSP)) + && eh_elf_context.rsp < 10)) + { + Debug(4, "EH_ELF err. -5: rip=%lX, rsp=%lX (ip = %lX) Flags: %x (%d)\n", + eh_elf_context.rip, eh_elf_context.rsp, ip, + eh_elf_context.flags, eh_elf_context.flags & (1<