From 07d20ac135cc2eade977c056a76e5f15883251b2 Mon Sep 17 00:00:00 2001 From: Mintsuki Date: Tue, 14 Apr 2026 14:47:56 +0200 Subject: [PATCH] fs/iso9660: Move sysarea pointer computation after bounds check --- common/fs/iso9660.s2.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/fs/iso9660.s2.c b/common/fs/iso9660.s2.c index 6734e111..afc10d19 100644 --- a/common/fs/iso9660.s2.c +++ b/common/fs/iso9660.s2.c @@ -173,13 +173,12 @@ static struct iso9660_context *iso9660_get_context(struct volume *vol) { } static bool load_name(char *buf, size_t limit, struct iso9660_directory_entry *entry) { - unsigned char* sysarea = ((unsigned char*)entry) + sizeof(struct iso9660_directory_entry) + entry->filename_size; - // Validate entry->length is large enough if (entry->length < sizeof(struct iso9660_directory_entry) + entry->filename_size) { goto use_iso_name; } + unsigned char* sysarea = ((unsigned char*)entry) + sizeof(struct iso9660_directory_entry) + entry->filename_size; size_t sysarea_len = entry->length - sizeof(struct iso9660_directory_entry) - entry->filename_size; if ((entry->filename_size & 0x1) == 0) { if (sysarea_len == 0) {