File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -750,7 +750,13 @@ int fat32_mount(void) {
750750 kprintf ("[FAT32] Data starts at sector %u\n" , data_start_sector );
751751 kprintf ("[FAT32] Root directory cluster: %u\n" , root_dir_cluster );
752752 kprintf ("[FAT32] Sectors per cluster: %u\n" , sectors_per_cluster );
753- kprintf ("[FAT32] Volume label: %.11s\n" , boot_sector .volume_label );
753+ /* vformat has no precision support, so "%.11s" printed literally on every
754+ * successful mount. The field is a non-NUL-terminated uint8_t[11], so plain
755+ * %s would read past it -- copy and terminate instead. */
756+ char vol_label [12 ];
757+ memcpy (vol_label , boot_sector .volume_label , 11 );
758+ vol_label [11 ] = '\0' ;
759+ kprintf ("[FAT32] Volume label: %s\n" , vol_label );
754760
755761 fat32_mounted = true;
756762 kprintf ("[FAT32] Mount successful [OK]\n" );
You can’t perform that action at this time.
0 commit comments