-
-
Notifications
You must be signed in to change notification settings - Fork 373
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 fpe and heap buffer overflow #3922
Conversation
librz/bin/format/le/le.c
Outdated
@@ -1128,6 +1128,7 @@ static RzVector /*<LE_map>*/ *le_create_maps(rz_bin_le_obj_t *bin) { | |||
rz_vector_foreach(le_maps, m) { | |||
max_vaddr = RZ_MAX(max_vaddr, m->vaddr + m->vsize); | |||
} | |||
CHECK(h->pagesize); | |||
bin->reloc_target_map_base = max_vaddr - max_vaddr % h->pagesize + h->pagesize * 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add parenthesis for better reading.
librz/bin/format/pyc/marshal.c
Outdated
ut32 n; | ||
|
||
n = get_ut32(buffer, &error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ut32 n; | |
n = get_ut32(buffer, &error); | |
ut32 n = get_ut32(buffer, &error); |
librz/bin/format/pyc/marshal.c
Outdated
ut32 n = 0; | ||
|
||
n = get_ut32(buffer, &error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ut32 n = 0; | |
n = get_ut32(buffer, &error); | |
ut32 n = get_ut32(buffer, &error); |
librz/bin/format/pyc/marshal.c
Outdated
} | ||
if (error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | |
if (error) { | |
} else if (error) { |
d64ea2a
to
b3d5863
Compare
Your checklist for this pull request
Detailed description
le_create_maps()
didn't check forh->pagesize
to be non-zero.get_ascii_object()
andget_ascii_interned_object()
didn't checkn
to be less or equal thanST32_MAX
. This could lead to heap buffer overflow inget_bytes()
.Test plan
CI is green