From b7ccc1b29674937ab4c97d0e1b7b5bfd6f366b92 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Tue, 10 Nov 2020 15:42:46 -0800 Subject: [PATCH 26/42] hfs: Fix gcc 10 bounds check warning binfo is actually a list of structs that cannot be known until runtime, so use a variable length array. --- libparted/fs/hfs/hfs.h | 2 +- libparted/fs/r/hfs/hfs.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libparted/fs/hfs/hfs.h b/libparted/fs/hfs/hfs.h index 4fa2e95..0a9392a 100644 --- a/libparted/fs/hfs/hfs.h +++ b/libparted/fs/hfs/hfs.h @@ -529,7 +529,7 @@ struct __attribute__ ((packed)) _HfsJBlockListHeader { uint32_t bytes_used; uint32_t checksum; uint32_t pad; - HfsJBlockInfo binfo[1]; + HfsJBlockInfo binfo[]; }; typedef struct _HfsJBlockListHeader HfsJBlockListHeader; diff --git a/libparted/fs/r/hfs/hfs.h b/libparted/fs/r/hfs/hfs.h index 4fa2e95..0a9392a 100644 --- a/libparted/fs/r/hfs/hfs.h +++ b/libparted/fs/r/hfs/hfs.h @@ -529,7 +529,7 @@ struct __attribute__ ((packed)) _HfsJBlockListHeader { uint32_t bytes_used; uint32_t checksum; uint32_t pad; - HfsJBlockInfo binfo[1]; + HfsJBlockInfo binfo[]; }; typedef struct _HfsJBlockListHeader HfsJBlockListHeader; -- 2.26.2