radare2/shlr/capstone-patches/v4/sparc-crash.patch
pancake 2434c3ca74
Switch to Capstone5 as default ##asm (#18127)
* Add riscv for capstone5 in the meson
* Report capstone version in the asm plugins
* Many changes in the ppc analysis, seems like it's improved, (emulation quality and xrefs)
* Update all tests and report issues in capstone4 to upstream
* Fix-x86-16 test marked as broken as it needs better fix
2021-04-24 22:04:51 +02:00

15 lines
580 B
Diff

diff --git a/arch/Sparc/SparcGenAsmWriter.inc b/arch/Sparc/SparcGenAsmWriter.inc
index d290d3b2..4d0d71cd 100644
--- a/arch/Sparc/SparcGenAsmWriter.inc
+++ b/arch/Sparc/SparcGenAsmWriter.inc
@@ -1202,6 +1202,9 @@ static const char *getRegisterName(unsigned RegNo)
//for (i = 0; i < sizeof(RegAsmOffset)/2; i++)
// printf("%s = %u\n", AsmStrs+RegAsmOffset[i], i + 1);
//printf("*************************\n");
+if (RegNo < 1 || RegNo > sizeof (RegAsmOffset) / sizeof (*RegAsmOffset)) {
+ return NULL;
+}
return AsmStrs+RegAsmOffset[RegNo-1];
#else
return NULL;