Constant EXT4_NAME_MAX is related to EXT4_DIR_ENTRY FS structure, so it should be placed into Ext4Disk.h header
Cc: Marvin Häuser <mhaeu...@posteo.de> Cc: Pedro Falcato <pedro.falc...@gmail.com> Cc: Vitaly Cheptsov <vit9...@protonmail.com> Fixes: e55f0527dde48a5f139c1b8f35acc4e6b59dd794 Signed-off-by: Savva Mitrofanov <savva...@gmail.com> --- Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h | 4 +++- Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h b/Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h index 4fd91a423324..1285644dcb25 100644 --- a/Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h +++ b/Features/Ext4Pkg/Ext4Dxe/Ext4Disk.h @@ -397,12 +397,14 @@ typedef struct _Ext4Inode { UINT32 i_projid; } EXT4_INODE; +#define EXT4_NAME_MAX 255 + typedef struct { UINT32 inode; UINT16 rec_len; UINT8 name_len; UINT8 file_type; - CHAR8 name[255]; + CHAR8 name[EXT4_NAME_MAX]; } EXT4_DIR_ENTRY; #define EXT4_MIN_DIR_ENTRY_LEN 8 diff --git a/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h b/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h index adf3c13f6ea9..81ba568c5947 100644 --- a/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h +++ b/Features/Ext4Pkg/Ext4Dxe/Ext4Dxe.h @@ -31,8 +31,7 @@ #include "Ext4Disk.h" -#define SYMLOOP_MAX 8 -#define EXT4_NAME_MAX 255 +#define SYMLOOP_MAX 8 // // We need to specify path length limit for security purposes, to prevent possible // overflows and dead-loop conditions. Originally this limit is absent in FS design, -- 2.38.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#97262): https://edk2.groups.io/g/devel/message/97262 Mute This Topic: https://groups.io/mt/95622330/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-