From 3f5c5879a9c90860b0f412740aecf5c97c68de12 Mon Sep 17 00:00:00 2001 From: benno Date: Fri, 23 Mar 2018 22:59:45 +0000 Subject: [PATCH] Don't try to modify El Torito section headers if there aren't any. MFC after: 1 week --- usr.sbin/makefs/cd9660/cd9660_eltorito.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr.sbin/makefs/cd9660/cd9660_eltorito.c b/usr.sbin/makefs/cd9660/cd9660_eltorito.c index b0ed19eee4b3..05d4bdf3525f 100644 --- a/usr.sbin/makefs/cd9660/cd9660_eltorito.c +++ b/usr.sbin/makefs/cd9660/cd9660_eltorito.c @@ -468,11 +468,14 @@ cd9660_setup_boot(iso9660_disk *diskStructure, int first_sector) } /* Find the last Section Header entry and mark it as the last. */ + head = NULL; LIST_FOREACH(next, &diskStructure->boot_entries, ll_struct) { if (next->entry_type == ET_ENTRY_SH) head = next; } - head->entry_data.SH.header_indicator[0] = ET_SECTION_HEADER_LAST; + if (head != NULL) + head->entry_data.SH.header_indicator[0] = + ET_SECTION_HEADER_LAST; /* TODO: Remaining boot disks when implemented */