summaryrefslogtreecommitdiff
blob: 3ddc610d4afc60a22ff8b9e2895a6a1fc581bf5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
https://bugs.gentoo.org/586092

this might not be correct, but at least it builds, and doesn't crash

--- a/src/coredump/_UCD_access_reg_linux.c
+++ b/src/coredump/_UCD_access_reg_linux.c
@@ -51,6 +51,9 @@ _UCD_access_reg (unw_addr_space_t as,
 #elif defined(UNW_TARGET_TILEGX)
   if (regnum < 0 || regnum > UNW_TILEGX_CFA)
     goto badreg;
+#elif defined(UNW_TARGET_IA64) || defined(UNW_TARGET_HPPA) || defined(UNW_TARGET_PPC32) || defined(UNW_TARGET_PPC64)
+  if (regnum < 0 || regnum >= ARRAY_SIZE(ui->prstatus->pr_reg))
+    goto badreg;
 #else
 #if defined(UNW_TARGET_MIPS)
   static const uint8_t remap_regs[] =