Ventoy icon indicating copy to clipboard operation
Ventoy copied to clipboard

fix(fs/iso9660): Correct improper cast for Rock Ridge flags

Open kairosci-dev opened this issue 3 months ago • 1 comments

Improve Rock Ridge flag access in ISO9660 parser

Description

This commit refactors the way Rock Ridge flags are accessed in the ISO9660 parser. Previously, the code used a cast on entry->u.data to check for GRUB_ISO9660_RR_DOT and GRUB_ISO9660_RR_DOTDOT flags. This approach was marked with a FIXME comment due to its unsafe and unclear nature. The updated implementation accesses the flags through entry->u.version, eliminating the need for casting and improving code clarity.

Motivation

The original cast on entry->u.data was not only flagged as problematic but also introduced potential risks in terms of type safety and maintainability. By switching to entry->u.version, the code now adheres to a cleaner and more correct method of accessing Rock Ridge flags. This change enhances readability, aligns with best practices, and resolves the longstanding FIXME in the codebase.

kairosci-dev avatar Sep 09 '25 17:09 kairosci-dev

It would be better to submit this patch upstream to GNU GRUB. https://cgit.git.savannah.gnu.org/cgit/grub.git/tree/grub-core/fs/iso9660.c#n629

a1ive avatar Sep 16 '25 14:09 a1ive