mirror of
https://github.com/radareorg/radare2.git
synced 2025-01-08 22:30:30 +00:00
Fix last covs
This commit is contained in:
parent
4ffa233300
commit
3bc07a2d5b
@ -380,6 +380,7 @@ RList *r_bin_le_get_sections(r_bin_le_obj_t *bin) {
|
||||
if (r < (int)sizeof (page)) {
|
||||
R_LOG_WARN ("Cannot read out of bounds page table entry");
|
||||
r_bin_section_free (s);
|
||||
r_bin_section_free (sec);
|
||||
return l;
|
||||
}
|
||||
if (cur_idx < next_idx) { // If not true rest of pages will be zeroes
|
||||
|
@ -30,7 +30,7 @@ static ut8 get_ut8(RBuffer *buffer, bool *error) {
|
||||
}
|
||||
|
||||
static ut16 get_ut16(RBuffer *buffer, bool *error) {
|
||||
ut8 data[2];
|
||||
ut8 data[2] = {0};
|
||||
*error = false;
|
||||
int size = r_buf_read (buffer, (ut8 *)&data, sizeof (data));
|
||||
if (size != sizeof (data)) {
|
||||
@ -40,7 +40,7 @@ static ut16 get_ut16(RBuffer *buffer, bool *error) {
|
||||
}
|
||||
|
||||
static ut32 get_ut32(RBuffer *buffer, bool *error) {
|
||||
ut8 data[4];
|
||||
ut8 data[4] = {0};
|
||||
*error = false;
|
||||
int size = r_buf_read (buffer, (ut8 *)&data, sizeof (data));
|
||||
if (size != sizeof (data)) {
|
||||
@ -321,13 +321,12 @@ static pyc_object *get_binary_float_object(RBuffer *buffer) {
|
||||
}
|
||||
|
||||
static pyc_object *get_complex_object(RBuffer *buffer) {
|
||||
pyc_object *ret = NULL;
|
||||
bool error = false;
|
||||
ut32 size = 0;
|
||||
st32 n1 = 0;
|
||||
st32 n2 = 0;
|
||||
|
||||
ret = R_NEW0 (pyc_object);
|
||||
pyc_object *ret = R_NEW0 (pyc_object);
|
||||
if (!ret) {
|
||||
return NULL;
|
||||
}
|
||||
@ -463,9 +462,7 @@ static pyc_object *get_unicode_object(RBuffer *buffer) {
|
||||
static pyc_object *get_interned_object(RBuffer *buffer) {
|
||||
pyc_object *ret = NULL;
|
||||
bool error = false;
|
||||
ut32 n = 0;
|
||||
|
||||
n = get_ut32 (buffer, &error);
|
||||
ut32 n = get_ut32 (buffer, &error);
|
||||
if (n > ST32_MAX) {
|
||||
R_LOG_DEBUG ("bad marshal data (string size out of range)");
|
||||
return NULL;
|
||||
|
@ -1,10 +1,7 @@
|
||||
/* radare2 - LGPL - Copyright 2017 - pancake, cgvwzq */
|
||||
/* radare2 - LGPL - Copyright 2017-2022 - pancake, cgvwzq, Dennis Goodlett */
|
||||
|
||||
#include <r_types.h>
|
||||
#include <r_util.h>
|
||||
#include <r_lib.h>
|
||||
#include <r_bin.h>
|
||||
|
||||
#include "wasm.h"
|
||||
|
||||
typedef size_t (*ConsumeFcn) (const ut8 *p, const ut8 *bound, ut32 *out_value);
|
||||
@ -626,12 +623,10 @@ static RBinWasmCustomNameEntry *parse_custom_name_entry(RBuffer *b, ut64 bound)
|
||||
break;
|
||||
case R_BIN_WASM_NAMETYPE_Function:
|
||||
cust->func = R_NEW0 (RBinWasmCustomNameFunctionNames);
|
||||
if (cust->func) {
|
||||
if (!cust->func) {
|
||||
goto beach;
|
||||
}
|
||||
|
||||
cust->func->names = r_id_storage_new (0, UT32_MAX);
|
||||
|
||||
if (!cust->func->names) {
|
||||
goto beach;
|
||||
}
|
||||
|
@ -4564,6 +4564,7 @@ static int cmd_debug_continue(RCore *core, const char *input) {
|
||||
r_cons_break_pop ();
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
case 'u': // "dcu"
|
||||
if (input[2] == '?') {
|
||||
r_core_cmd_help (core, help_msg_dcu);
|
||||
|
@ -1545,7 +1545,11 @@ static RList *lart_new(void) {
|
||||
return r_list_newf (free);
|
||||
}
|
||||
|
||||
static void r_core_cmd_print_binformat(RCore *core, const char *arg) {
|
||||
static void lart_free(RList *list) {
|
||||
r_list_free (list);
|
||||
}
|
||||
|
||||
static void r_core_cmd_print_binformat(RCore *core, const char *arg, int mode) {
|
||||
// r_io_read_at (core->io, core->offset, buf, sizeof (buf));
|
||||
const char *fmt = arg;
|
||||
int n = 0;
|
||||
@ -1555,7 +1559,6 @@ static void r_core_cmd_print_binformat(RCore *core, const char *arg) {
|
||||
names = strdup (names + 1);
|
||||
lnames = r_str_split_list (names, " ", 0);
|
||||
}
|
||||
int mode = PFB_ART;
|
||||
int i = 0;
|
||||
int bpos = 0;
|
||||
ut64 v = 0;
|
||||
@ -1570,6 +1573,8 @@ static void r_core_cmd_print_binformat(RCore *core, const char *arg) {
|
||||
n = atoi (arg);
|
||||
if (n > 64) {
|
||||
eprintf ("Too large. Max is 64\n");
|
||||
lart_free (lart);
|
||||
r_bitmap_free (bm);
|
||||
return;
|
||||
}
|
||||
while (IS_DIGIT (*arg)) {
|
||||
@ -1582,6 +1587,8 @@ static void r_core_cmd_print_binformat(RCore *core, const char *arg) {
|
||||
} else if (*arg == 'b') {
|
||||
if (n < 1) {
|
||||
eprintf ("Invalid bitformat string.\n");
|
||||
lart_free (lart);
|
||||
r_bitmap_free (bm);
|
||||
return;
|
||||
}
|
||||
char *name = lnames? r_list_get_n (lnames, i): NULL;
|
||||
@ -1660,6 +1667,7 @@ static void r_core_cmd_print_binformat(RCore *core, const char *arg) {
|
||||
}
|
||||
}
|
||||
r_bitmap_free (bm);
|
||||
lart_free (lart);
|
||||
r_list_free (lnames);
|
||||
}
|
||||
|
||||
@ -1746,7 +1754,7 @@ static void cmd_print_format(RCore *core, const char *_input, const ut8* block,
|
||||
return;
|
||||
case 'b': // "pfb"
|
||||
if (_input[2] == ' ') {
|
||||
r_core_cmd_print_binformat (core, r_str_trim_head_ro (_input + 2));
|
||||
r_core_cmd_print_binformat (core, r_str_trim_head_ro (_input + 2), PFB_ART);
|
||||
} else {
|
||||
eprintf ("Usage: pfb [binfmt] [names...]\n");
|
||||
}
|
||||
|
@ -66,6 +66,7 @@ static void print_c_instructions(RPrint *p, ut64 addr, const ut8 *buf, int len)
|
||||
}
|
||||
|
||||
static void print_c_code(RPrint *p, ut64 addr, const ut8 *buf, int len, int ws, int w) {
|
||||
r_return_if_fail (p && p->cb_printf);
|
||||
size_t i;
|
||||
|
||||
ws = R_MAX (1, R_MIN (ws, 8));
|
||||
|
Loading…
Reference in New Issue
Block a user