From 59ad3b3c0b4cc5c86d9629284ee9785358be7cb0 Mon Sep 17 00:00:00 2001 From: Paul I Date: Sun, 24 Jan 2021 23:56:15 +0100 Subject: [PATCH] COFF: handle empty sections (#447) ##bin --- libr/bin/format/coff/coff.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libr/bin/format/coff/coff.c b/libr/bin/format/coff/coff.c index 7c2b7568d8..8d67dc0f32 100644 --- a/libr/bin/format/coff/coff.c +++ b/libr/bin/format/coff/coff.c @@ -202,8 +202,12 @@ static bool r_bin_coff_init_scn_va(struct r_bin_coff_obj *obj) { int i; ut64 va = 0; for (i = 0; i < obj->hdr.f_nscns; i++) { + ut64 sz = obj->scn_hdrs[i].s_size; + if (sz < 16) { + sz = 16; + } obj->scn_va[i] = va; - va += obj->scn_hdrs[i].s_size; + va += sz; va = R_ROUND (va, 16ULL); } return true;