Skip to content

Commit

Permalink
Fix null deref in the ne parser ##crash
Browse files Browse the repository at this point in the history
* Reported by @hmsec via huntr.dev
* Reproducer: nepoc00
* BountyID: bfeb8fb8-644d-4587-80d4-cb704c404013
  • Loading branch information
trufae committed Apr 8, 2022
1 parent 2b77b27 commit 18d1d06
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libr/bin/format/ne/ne.c
Expand Up @@ -115,7 +115,7 @@ RList *r_bin_ne_get_symbols(r_bin_ne_obj_t *bin) {
}
RList *entries = r_bin_ne_get_entrypoints (bin);
bool resident = true, first = true;
while (true) {
while (entries) {
ut8 sz = r_buf_read8_at (bin->buf, off);
if (!sz) {
first = true;
Expand Down Expand Up @@ -352,6 +352,9 @@ RList *r_bin_ne_get_imports(r_bin_ne_obj_t *bin) {
}

RList *r_bin_ne_get_entrypoints(r_bin_ne_obj_t *bin) {
if (!bin->entry_table) {
return NULL;
}
RList *entries = r_list_newf (free);
if (!entries) {
return NULL;
Expand Down

0 comments on commit 18d1d06

Please sign in to comment.