]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* grub-core/fs/fat.c (grub_fat_dir_entry) [MODE_EXFAT]: Expand label
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 31 Jan 2012 21:38:08 +0000 (22:38 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Tue, 31 Jan 2012 21:38:08 +0000 (22:38 +0100)
to 15 UTF-16 characters as seen in FS generated by mkexfatfs.
(grub_fat_label) [MODE_EXFAT]: Use macros for size.

ChangeLog
grub-core/fs/fat.c

index da706b6014867cb1b8453559989192c481e36731..becac92b6529d37b6f644044e30a1873106f72fa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-01-31  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * grub-core/fs/fat.c (grub_fat_dir_entry) [MODE_EXFAT]: Expand label
+       to 15 UTF-16 characters as seen in FS generated by mkexfatfs.
+       (grub_fat_label) [MODE_EXFAT]: Use macros for size.
+
 2012-01-31  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * grub-core/fs/romfs.c (grub_romfs_mount): Fix a bug with labels going
index 0569120fb7d55837f63c661bf6f19f4a0377b11c..6adc95c37c029d7479a77d3c6b9ba2d3042f8819 100644 (file)
@@ -122,8 +122,7 @@ struct grub_fat_dir_entry
     }  __attribute__ ((packed))  file_name;
     struct {
       grub_uint8_t character_count;
-      grub_uint16_t str[11];
-      grub_uint8_t reserved[8];
+      grub_uint16_t str[15];
     }  __attribute__ ((packed))  volume_label;
   }  __attribute__ ((packed)) type_specific;
 } __attribute__ ((packed));
@@ -1046,7 +1045,8 @@ grub_fat_label (grub_device_t device, char **label)
       if (dir.entry_type == 0x83)
        {
          grub_size_t chc;
-         *label = grub_malloc (11 * 4 + 1);
+         *label = grub_malloc (ARRAY_SIZE (dir.type_specific.volume_label.str)
+                               * GRUB_MAX_UTF8_PER_UTF16 + 1);
          if (!*label)
            {
              grub_free (data);