mirror of
https://github.com/radareorg/radare2.git
synced 2025-03-04 12:27:40 +00:00
Fix #12417/#12418 (arm assembler heap overflows)
This commit is contained in:
parent
db18c78456
commit
e5c14c167b
@ -6545,7 +6545,7 @@ ut32 armass_assemble(const char *str, ut64 off, int thumb) {
|
||||
int i, j;
|
||||
char buf[128];
|
||||
ArmOpcode aop = {.off = off};
|
||||
for (i = j = 0; i < sizeof (buf) - 1 && str[i]; i++, j++) {
|
||||
for (i = j = 0; i < sizeof (buf) - 1 && str[j]; i++, j++) {
|
||||
if (str[j] == '#') {
|
||||
i--; continue;
|
||||
}
|
||||
|
@ -756,7 +756,7 @@ static bool parseOperands(char* str, ArmOp *op) {
|
||||
} else if (!strncmp (token, "asr", 3)) {
|
||||
op->operands[operand].shift = ARM_ASR;
|
||||
}
|
||||
if (op->operands[operand].shift != ARM_NO_SHIFT) {
|
||||
if (strlen (token) > 4 && op->operands[operand].shift != ARM_NO_SHIFT) {
|
||||
op->operands_count ++;
|
||||
op->operands[operand].shift_amount = r_num_math (NULL, token + 4);
|
||||
if (op->operands[operand].shift_amount > 63) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user