From: Jan Kiszka <[email protected]>

Empty sections tend to have a zero data offset and will then invalidate
the calculation of the first section data in the file.

Signed-off-by: Jan Kiszka <[email protected]>
---
 tools/bg_gen_unified_kernel | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/bg_gen_unified_kernel b/tools/bg_gen_unified_kernel
index 5f3727c..e484b99 100755
--- a/tools/bg_gen_unified_kernel
+++ b/tools/bg_gen_unified_kernel
@@ -108,7 +108,7 @@ class PEHeaders:
                       file=sys.stderr)
                 exit(1)
 
-            if section.data_offs < self.first_data:
+            if section.data_size and section.data_offs < self.first_data:
                 self.first_data = section.data_offs
 
             self.sections.append(section)
-- 
2.35.3

-- 
You received this message because you are subscribed to the Google Groups "EFI 
Boot Guard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/efibootguard-dev/08d48bf6fd22d73d9383e6e7cc4cc8ec4d53ede0.1655731805.git.jan.kiszka%40siemens.com.

Reply via email to