]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
kern/partition: Unbreak support for nested partitions
authorVladimir Serbinenko <phcoder@gmail.com>
Sun, 2 Mar 2025 21:02:21 +0000 (00:02 +0300)
committerDaniel Kiper <daniel.kiper@oracle.com>
Wed, 5 Mar 2025 20:24:47 +0000 (21:24 +0100)
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 <phcoder@gmail.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/kern/partition.c

index c6a578cf4a90f0e059a881c730b10728dc7359ae..3b128e6d2de27b8508bd162acf64f3a54f1db250 100644 (file)
@@ -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;