diff --git a/libr/asm/arch/arm/armass64.c b/libr/asm/arch/arm/armass64.c index 028761ac47..4a55d9df8b 100644 --- a/libr/asm/arch/arm/armass64.c +++ b/libr/asm/arch/arm/armass64.c @@ -785,6 +785,7 @@ static bool parseOperands(char* str, ArmOp *op) { op->operands[operand].reg_type = ARM_REG64; op->operands[operand].reg = r_num_math (NULL, token + 1); if (op->operands[operand].reg > 31) { + free (t); return false; } break; @@ -794,6 +795,7 @@ static bool parseOperands(char* str, ArmOp *op) { op->operands[operand].reg_type = ARM_REG32; op->operands[operand].reg = r_num_math (NULL, token + 1); if (op->operands[operand].reg > 31) { + free (t); return false; } break; diff --git a/libr/asm/arch/dcpu16/asm.c b/libr/asm/arch/dcpu16/asm.c index e2ce8ed691..5c1f220aa2 100644 --- a/libr/asm/arch/dcpu16/asm.c +++ b/libr/asm/arch/dcpu16/asm.c @@ -207,7 +207,7 @@ int dcpu16_assemble (ut8* out, const char* unoline) { ut16 wordA = 0, wordB = 0; int basic_opcode = 0; int non_basic_opcode = 0; - char line[256], *param; + char line[256] = {0}, *param; int off = 0; // uberflow! clean_line (line, unoline); diff --git a/libr/core/cmd_print.c b/libr/core/cmd_print.c index 465361ab6c..160c08c35a 100644 --- a/libr/core/cmd_print.c +++ b/libr/core/cmd_print.c @@ -4583,7 +4583,7 @@ static int cmd_print(void *data, const char *input) { r_cons_printf (",\"addr\":%"PFMT64u, f->addr); r_cons_printf (",\"ops\":["); // instructions are all outputted as a json list - cont_size = f->_size > 0 ? f->_size : r_anal_fcn_realsize (f); + // DEAD CODE cont_size = f->_size > 0 ? f->_size : r_anal_fcn_realsize (f); bool first = true; bool prev_result = true; // TODO: can loc jump to another locs? diff --git a/libr/core/graph.c b/libr/core/graph.c index 801b27697c..bd3037c257 100644 --- a/libr/core/graph.c +++ b/libr/core/graph.c @@ -1673,6 +1673,7 @@ static void fix_back_edge_dummy_nodes (RAGraph *g, RANode *from, RANode *to) { } static int get_nth (const RAGraph *g, RANode *src, RANode *dst); + void backedge_info (RAGraph *g) { int i, j, k; int min, max; @@ -1826,8 +1827,8 @@ void backedge_info (RAGraph *g) { e->is_reversed = true; e->from = NULL; e->to = NULL; - e->x = r_list_new(); - e->y = r_list_new(); + e->x = r_list_new (); + e->y = r_list_new (); if (g->layout == 0) { r_list_append (e->y, (void *) (size_t) (n->y + g->layers[g->n_layers - 1].height + 2 + outedge)); } else { diff --git a/libr/crypto/p/crypto_aes_algo.c b/libr/crypto/p/crypto_aes_algo.c index 3c16ca9929..6a6cef4e59 100644 --- a/libr/crypto/p/crypto_aes_algo.c +++ b/libr/crypto/p/crypto_aes_algo.c @@ -244,14 +244,10 @@ void aes_decrypt (struct aes_state *st, ut8 *in, ut8 *result) { // Apply round transforms for (r = 1; r < st->rounds; r++) { - a0 = (RT0[(ut8)(t0 >> 24)] ^ RT1[(ut8)(t3 >> 16)] ^ RT2[(ut8)(t2 >> 8)] ^ - RT3[(ut8)t1]); - a1 = (RT0[(ut8)(t1 >> 24)] ^ RT1[(ut8)(t0 >> 16)] ^ RT2[(ut8)(t3 >> 8)] ^ - RT3[(ut8)t2]); - a2 = (RT0[(ut8)(t2 >> 24)] ^ RT1[(ut8)(t1 >> 16)] ^ RT2[(ut8)(t0 >> 8)] ^ - RT3[(ut8)t3]); - a3 = (RT0[(ut8)(t3 >> 24)] ^ RT1[(ut8)(t2 >> 16)] ^ RT2[(ut8)(t1 >> 8)] ^ - RT3[(ut8)t0]); + a0 = (RT0[(ut8)(t0 >> 24)] ^ RT1[(ut8)(t3 >> 16)] ^ RT2[(ut8)(t2 >> 8)] ^ RT3[(ut8)t1]); + a1 = (RT0[(ut8)(t1 >> 24)] ^ RT1[(ut8)(t0 >> 16)] ^ RT2[(ut8)(t3 >> 8)] ^ RT3[(ut8)t2]); + a2 = (RT0[(ut8)(t2 >> 24)] ^ RT1[(ut8)(t1 >> 16)] ^ RT2[(ut8)(t0 >> 8)] ^ RT3[(ut8)t3]); + a3 = (RT0[(ut8)(t3 >> 24)] ^ RT1[(ut8)(t2 >> 16)] ^ RT2[(ut8)(t1 >> 8)] ^ RT3[(ut8)t0]); t0 = a0 ^ expkey[1][r][0]; t1 = a1 ^ expkey[1][r][1]; t2 = a2 ^ expkey[1][r][2]; diff --git a/libr/debug/dreg.c b/libr/debug/dreg.c index 42e0075573..7181e52768 100644 --- a/libr/debug/dreg.c +++ b/libr/debug/dreg.c @@ -178,7 +178,7 @@ R_API int r_debug_reg_list(RDebug *dbg, int type, int size, int rad, const char if (tolower ((ut8)rad) == 'j') { snprintf (strvalue, sizeof (strvalue),"%"PFMT64u, value); } else { - if (pr->wide_offsets && dbg->bits & R_SYS_BITS_64) { + if (pr && pr->wide_offsets && dbg->bits & R_SYS_BITS_64) { snprintf (strvalue, sizeof (strvalue),"0x%016"PFMT64x, value); } else { snprintf (strvalue, sizeof (strvalue),"0x%08"PFMT64x, value); diff --git a/libr/parse/p/parse_x86_pseudo.c b/libr/parse/p/parse_x86_pseudo.c index 5d803c1b31..3c16174819 100644 --- a/libr/parse/p/parse_x86_pseudo.c +++ b/libr/parse/p/parse_x86_pseudo.c @@ -170,8 +170,8 @@ static int parse (RParse *p, const char *data, char *str) { if (!(buf = strdup (data))) { return false; } + *w0 = *w1 = *w2 = *w3 = '\0'; if (*buf) { - *w0 = *w1 = *w2 = *w3 = '\0'; end = strchr (buf, '\0'); ptr = strchr (buf, ' '); if (!ptr) {