Skip to content

Commit

Permalink
fix segfault when bin->symbols is NULL #21503
Browse files Browse the repository at this point in the history
  • Loading branch information
echel0nn authored and trufae committed Mar 21, 2023
1 parent ef8ec63 commit 508a630
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions libr/bin/p/bin_coff.c
Expand Up @@ -505,11 +505,13 @@ static RList *patch_relocs(RBin *b) {

size_t nimports = 0;
int i;
for (i = 0; i < bin->hdr.f_nsyms; i++) {
if (is_imported_symbol (&bin->symbols[i])) {
nimports++;
if (bin->symbols) {
for (i = 0; i < bin->hdr.f_nsyms; i++) {
if (is_imported_symbol (&bin->symbols[i])) {
nimports++;
}
i += bin->symbols[i].n_numaux;
}
i += bin->symbols[i].n_numaux;
}
ut64 m_vaddr = UT64_MAX;
if (nimports) {
Expand Down

1 comment on commit 508a630

@abergmann
Copy link

Choose a reason for hiding this comment

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

CVE-2023-1605 was assigned to this commit.

Please sign in to comment.