:: commit 66a34199df9b8cfc210e8f9ef2bb98c8ceebd45e

Mintsuki <mintsuki@protonmail.com> — 2026-02-07 16:06

parents: 7ac9eb0e86

fs/iso9660: Reject paths with trailing slash as files

diff --git a/common/fs/iso9660.s2.c b/common/fs/iso9660.s2.c
index 738e36cc..8c4728cb 100644
--- a/common/fs/iso9660.s2.c
+++ b/common/fs/iso9660.s2.c
@@ -385,13 +385,11 @@ struct file_handle *iso9660_open(struct volume *vol, const char *path) {
             // Use the current directory's extent info
             // For root, this was set from ret->context->root
             // For subdirs, it was set from the last matched entry
-            if (first) {
-                // Still at root - return NULL as we can't return root as a file
-                pmm_free(ret, sizeof(struct iso9660_file_handle));
-                return NULL;
+            if (!first) {
+                pmm_free(current, current_size);
             }
-            // Otherwise next_sector/next_size already set from last entry
-            break;
+            pmm_free(ret, sizeof(struct iso9660_file_handle));
+            return NULL;
         }
 
         char *aux = filename;
tab: 248 wrap: offon