FS#9102 - arm_disass seg faults in some rare situations
Opened by Martin Pahl (demapa) - Wednesday, 18 June 2008, 08:30 GMT
Last edited by Maurus Cuelenaere (mcuelenaere) - Wednesday, 30 July 2008, 15:59 GMT
I'm not sure which category to choose for this bug.
There is a bug in "void block_data(char *stg, ULONG val)" in the file "utils/disassembler/arm/disasm_arm.c" which leads to a segmentation fault in some cases, probably if you feed the function with illegal code.
void block_data(char *stg, ULONG val)
for(i=0; i<16; i++)
if(val & (1<<i))
sprintf(lst+strlen(lst), "%s, ", regs[i]);
This strcpy-function is illegal if no reg is found in the loop before, because the string "}" is then copied to the position -1, which corrupts other variables. There should be an additional if-clause like this:
I think a patch file is not necessary, as it is very easy to patch witch copy-and-paste from this message.
Wednesday, 30 July 2008, 15:59 GMT
Reason for closing: Accepted
Additional comments about closing: Thanks!