summaryrefslogtreecommitdiff
path: root/usr/src/lib/libgrubmgmt/common/libgrub_cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/lib/libgrubmgmt/common/libgrub_cmd.c')
-rw-r--r--usr/src/lib/libgrubmgmt/common/libgrub_cmd.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/usr/src/lib/libgrubmgmt/common/libgrub_cmd.c b/usr/src/lib/libgrubmgmt/common/libgrub_cmd.c
index 5dc12247b1..4166f2ee4c 100644
--- a/usr/src/lib/libgrubmgmt/common/libgrub_cmd.c
+++ b/usr/src/lib/libgrubmgmt/common/libgrub_cmd.c
@@ -402,10 +402,15 @@ findroot(const grub_line_t *lp, grub_barg_t *barg)
return (EG_FINDROOTFMT);
++pos;
- if ((pos[0] != ',' && pos[0] != ')') ||
- !IS_SLCNUM_VALID(barg->gb_slcnum = pos[1]) ||
- pos[2] != ')')
- return (EG_FINDROOTFMT);
+ /*
+ * check the slice only when its presented
+ */
+ if (pos[0] != ')') {
+ if (pos[0] != ',' ||
+ !IS_SLCNUM_VALID(barg->gb_slcnum = pos[1]) ||
+ pos[2] != ')')
+ return (EG_FINDROOTFMT);
+ }
} else {
sz = strlen(sign);
}