Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some last coverities #10735

Merged
merged 5 commits into from Jul 16, 2018
Merged

Fix some last coverities #10735

merged 5 commits into from Jul 16, 2018

Conversation

cyanpencil
Copy link
Contributor

No description provided.

@cyanpencil
Copy link
Contributor Author

I believe the wrong tests are all due to the recent changes in r2regressions, but let's wait that they get resolved to be 100% sure

@cyanpencil cyanpencil force-pushed the fix-coverities branch 5 times, most recently from 21de862 to 5bda075 Compare July 15, 2018 20:22
libr/asm/asm.c Outdated
@@ -309,10 +309,12 @@ R_API int r_asm_use(RAsm *a, const char *name) {
r_list_foreach (a->plugins, iter, h) {
if (!strcmp (h->name, name) && h->arch) {
if (!a->cur || (a->cur && strcmp (a->cur->arch, h->arch))) {
char *file = r_str_newf ("%s/%s.sdb", r_str_r2_prefix (R2_SDB_OPCODES), h->arch);
char *r2prefix = r_str_r2_prefix (R2_SDB_OPCODES);
char *file = r_str_newf ("%s/%s.sdb", r2prefix, h->arch);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r2prefix can be null, so better use r_str_get in here to avoid the undefined behaviour of passing NULL to %s. or just if (r2prefix) { ...

@radare
Copy link
Collaborator

radare commented Jul 16, 2018

please rebase. master should be green

@cyanpencil cyanpencil force-pushed the fix-coverities branch 2 times, most recently from 33b19a1 to 030f0d5 Compare July 16, 2018 17:13
@cyanpencil
Copy link
Contributor Author

Ok finally green now :)

@radare radare merged commit 9639afa into radareorg:master Jul 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants