Skip to contentSkip to conversation

mkfs: don't overflow the subopts array

PATCH In review Darrick J. Wong 2 participants 2 messages Sep 27, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mkfs: don't overflow the subopts array

The new -d cowextsize option overran the subopts array; make it larger.

---
 mkfs/xfs_mkfs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mkfs/xfs_mkfs.c +1 -1
index 2acf8bf..7c407b0 100644
@@ -39,7 +39,7 @@ static int  ispow2(unsigned int i);
 unsigned int		blocksize;
 unsigned int		sectorsize;
 
-#define MAX_SUBOPTS	16
+#define MAX_SUBOPTS	17
 #define SUBOPT_NEEDS_VAL	(-1LL)
 #define MAX_CONFLICTS	8
 #define LAST_CONFLICT	(-1)
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · Darrick J. Wong

The new -d cowextsize option overran the subopts array; make it larger.

Sigh, sorry for missing that on review, and build, and build, and another build. :(

Quoted 18 lines
---
 mkfs/xfs_mkfs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mkfs/xfs_mkfs.c +1 -1
index 2acf8bf..7c407b0 100644
@@ -39,7 +39,7 @@ static int  ispow2(unsigned int i);
 unsigned int		blocksize;
 unsigned int		sectorsize;
 
-#define MAX_SUBOPTS	16
+#define MAX_SUBOPTS	17
 #define SUBOPT_NEEDS_VAL	(-1LL)
 #define MAX_CONFLICTS	8
 #define LAST_CONFLICT	(-1)