mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-01 11:11:56 +00:00
Fix more clang-analyzer warnings (#12427)
This commit is contained in:
parent
2ebd956fdd
commit
d067c16266
@ -50,8 +50,6 @@ static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) {
|
||||
r_asm_op_set_asm (op, "invalid");
|
||||
op->size = 4;
|
||||
goto beach;
|
||||
} else {
|
||||
ret = 4;
|
||||
}
|
||||
if (insn->size < 1) {
|
||||
goto beach;
|
||||
|
@ -2253,7 +2253,6 @@ static int oppush(RAsm *a, ut8 *data, const Opcode *op) {
|
||||
} else if (op->operands[0].type & OT_MEMORY) {
|
||||
data[l++] = 0xff;
|
||||
offset = op->operands[0].offset * op->operands[0].offset_sign;
|
||||
mod = 0;
|
||||
if (offset != 0 || op->operands[0].regs[0] == X86R_EBP) {
|
||||
mod = 1;
|
||||
if (offset >= 128 || offset < -128) {
|
||||
|
@ -873,6 +873,7 @@ static RList *strings(RBinFile *bf) {
|
||||
ptr->string[len] = 0;
|
||||
if ((ptr->string[0] == 'L' && strchr (ptr->string, '/')) || !strncmp (ptr->string, "[L", 2)) {
|
||||
free (ptr->string);
|
||||
free (ptr);
|
||||
continue;
|
||||
}
|
||||
ptr->vaddr = ptr->paddr = bin->strings[i];
|
||||
|
@ -325,6 +325,7 @@ R_API char *r_cons_hud_path(const char *path, int dir) {
|
||||
if (ret) {
|
||||
tmp = r_str_append (tmp, "/");
|
||||
tmp = r_str_append (tmp, ret);
|
||||
free (ret);
|
||||
ret = r_file_abspath (tmp);
|
||||
free (tmp);
|
||||
tmp = ret;
|
||||
|
@ -5712,7 +5712,7 @@ R_API int r_core_print_disasm_all(RCore *core, ut64 addr, int l, int len, int mo
|
||||
}
|
||||
ret = r_asm_disassemble (core->assembler, &asmop, buf + i, l - i);
|
||||
if (ret < 1) {
|
||||
ret = err = 1;
|
||||
err = 1;
|
||||
switch (mode) {
|
||||
case 'j':
|
||||
case '=':
|
||||
@ -5864,11 +5864,10 @@ R_API int r_core_disasm_pdi(RCore *core, int nb_opcodes, int nb_bytes, int fmt)
|
||||
int len = (nb_opcodes + nb_bytes) * 5;
|
||||
if (core->fixedblock) {
|
||||
len = core->blocksize;
|
||||
} else {
|
||||
if (len > core->blocksize) {
|
||||
r_core_block_size (core, len);
|
||||
r_core_block_read (core);
|
||||
}
|
||||
}
|
||||
if (len > core->blocksize) {
|
||||
r_core_block_size (core, len);
|
||||
r_core_block_read (core);
|
||||
}
|
||||
r_cons_break_push (NULL, NULL);
|
||||
|
||||
|
@ -125,7 +125,6 @@ R_API int r_diff_buffers_static(RDiff *d, const ut8 *a, int la, const ut8 *b, in
|
||||
.b_off = d->off_b+i-hit, .b_buf = b+i-hit, .b_len = R_MIN (hit, rb)
|
||||
};
|
||||
d->callback (d, d->user, &o);
|
||||
hit = 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -2324,7 +2324,7 @@ R_API int r_print_format_length(const char *fmt) {
|
||||
const char *argend = arg+strlen (fmt);
|
||||
char namefmt[8];
|
||||
int viewflags = 0;
|
||||
nargs = endian = i = j = 0;
|
||||
endian = i = j = 0;
|
||||
|
||||
while (*arg && IS_WHITECHAR (*arg)) {
|
||||
arg++;
|
||||
|
@ -690,10 +690,11 @@ R_API int r_sys_cmd(const char *str) {
|
||||
}
|
||||
|
||||
R_API char *r_sys_cmd_str(const char *cmd, const char *input, int *len) {
|
||||
char *output;
|
||||
char *output = NULL;
|
||||
if (r_sys_cmd_str_full (cmd, input, &output, len, NULL)) {
|
||||
return output;
|
||||
}
|
||||
free (output);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user