From ee27f07a650d13f66ba7b867de3b39ddeb3631ec Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Mon, 3 Mar 2025 00:02:21 +0300 Subject: [PATCH] kern/partition: Unbreak support for nested partitions When using syntax "hd0,gtp3,dfly1" then ptr points to trailing part, ",dfly1". So, it's improper to consider it as an invalid partition. Signed-off-by: Vladimir Serbinenko Reviewed-by: Daniel Kiper --- grub-core/kern/partition.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grub-core/kern/partition.c b/grub-core/kern/partition.c index c6a578cf4..3b128e6d2 100644 --- a/grub-core/kern/partition.c +++ b/grub-core/kern/partition.c @@ -134,7 +134,7 @@ grub_partition_probe (struct grub_disk *disk, const char *str) partname_end = ptr; num = grub_strtoul (ptr, &ptr, 0); - if (*ptr != '\0' || num == 0 || num > GRUB_INT_MAX) + if (num == 0 || num > GRUB_INT_MAX) { grub_error (GRUB_ERR_BAD_NUMBER, N_("invalid partition number")); return 0; -- 2.47.2