Fix last covs

This commit is contained in:
pancake 2022-09-30 13:47:18 +02:00 committed by pancake
parent ae108d7a69
commit 5d6ae50e2d
5 changed files with 13 additions and 7 deletions

View File

@ -112,8 +112,6 @@ static bool strbuf_rev_prepend_char(RStrBuf *sb, const char *s, int c) {
memcpy (ns + idx + l, sb_str + idx, sb->len - idx);
ns[newlen] = 0;
ret = r_strbuf_set (sb, ns);
} else {
free (ns);
}
free (ns);
return ret;

View File

@ -31,12 +31,15 @@ DECLARE_GENERIC_PRINT_ADDRESS_FUNC_NOGLOBALS()
DECLARE_GENERIC_FPRINTF_FUNC_NOGLOBALS()
static int disassemble(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *buf, int len) {
ut8 bytes[8] = {0};
ut8 bytes[4] = {0};
struct disassemble_info disasm_obj;
if (len < 4) {
return -1;
}
RStrBuf *sb = r_strbuf_new ("");
if (!sb) {
return -1;
}
// disasm inverted
memcpy (bytes, buf, R_MIN (sizeof (bytes), len));
@ -435,7 +438,7 @@ static void anal_branch(RAnalOp *op, const ut32 insn, const ut64 addr) {
// TODO: this implementation is just a fast hack. needs to be rewritten and completed
static int sparc_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int len, RAnalOpMask mask) {
int sz = 4;
ut32 insn;
ut32 insn = 0;
op->family = R_ANAL_OP_FAMILY_CPU;
op->addr = addr;
@ -443,7 +446,7 @@ static int sparc_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int le
r_mem_swaporcopy ((ut8*)&insn, data, 4, !anal->config->big_endian);
if (mask & R_ANAL_OP_MASK_DISASM) {
disassemble (anal, op, addr, (ut8 *)&insn, len);
disassemble (anal, op, addr, (ut8 *)&insn, 4);
}
if (X_OP (insn) == OP_0) {

View File

@ -700,7 +700,7 @@ R_API bool r_core_project_save(RCore *core, const char *prj_name) {
if (r_list_append (paths, prj_dir)) {
const char *author = r_config_get (core->config, "cfg.user");
const char *message = r_config_get (core->config, "prj.vc.message");
if (!rvc_git_commit (core->prj->rvc, author, message, paths)) {
if (!rvc_git_commit (core->prj->rvc, message, author, paths)) {
r_list_free (paths);
free (prj_dir);
free (script_path);

View File

@ -1083,6 +1083,7 @@ R_API bool r_vc_clone(const Rvc *rvc, const char *dst) {
} else {
R_LOG_ERROR ("Failed to reset");
}
r_vc_free (dst_repo);
}
} else {
R_LOG_ERROR ("Failed to copy files");
@ -1115,7 +1116,10 @@ R_API Rvc *r_vc_git_open(const char *path) {
return NULL;
}
vc->db = NULL;
r_vc_use (vc, RVC_TYPE_GIT);
if (!r_vc_use (vc, RVC_TYPE_GIT)) {
r_vc_free (vc);
return NULL;
}
return vc;
}

View File

@ -70,6 +70,7 @@ R_API bool r_vc_clone(const Rvc *rvc, const char *dst);
R_API Rvc *r_vc_open(const char *rp, RvcType type);
R_API void r_vc_close(Rvc *vc, bool save);
R_API bool r_vc_save(Rvc *vc);
R_API void r_vc_free(Rvc *vc);
R_API RList *r_vc_git_get_branches(Rvc *rvc);
R_API RList *r_vc_git_get_uncommitted(Rvc *rvc);