Skip to content

Commit

Permalink
Bugfix strncpy instead of strcpy
Browse files Browse the repository at this point in the history
  • Loading branch information
chregu82 committed Jul 16, 2020
1 parent 3f9a7b9 commit 41a9f1a
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 3 deletions.
Binary file modified bin/kernel.img
Binary file not shown.
Binary file modified bin/kernel7.img
Binary file not shown.
Binary file modified bin/kernel8-32.img
Binary file not shown.
Binary file modified bin/recovery7l.img
Binary file not shown.
2 changes: 1 addition & 1 deletion pigfx_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

#define PIGFX_MAJVERSION 1 /* Major version number */
#define PIGFX_MINVERSION 6 /* Minor version number */
#define PIGFX_BUILDVERSION 0 /* Build version. */
#define PIGFX_BUILDVERSION 1 /* Build version. */

/** Versions:

Expand Down
4 changes: 2 additions & 2 deletions src/fat.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ int fat_init(struct block_device *parent, struct fs **fs)
if(ret->fat_type == FAT32)
{
// FAT32
pigfx_strcpy(ret->vol_label, bs->ext.fat32.volume_label);
pigfx_strncpy(ret->vol_label, bs->ext.fat32.volume_label, 11);
ret->vol_label[11] = 0;
ee_printf("FAT: volume label: %s\n", ret->vol_label);

Expand All @@ -370,7 +370,7 @@ int fat_init(struct block_device *parent, struct fs **fs)
{
// FAT12/16

pigfx_strcpy(ret->vol_label, bs->ext.fat16.volume_label);
pigfx_strncpy(ret->vol_label, bs->ext.fat16.volume_label, 11);
ret->vol_label[11] = 0;
#ifdef FAT_DEBUG
ee_printf("FAT: volume label: %s\n", ret->vol_label);
Expand Down

0 comments on commit 41a9f1a

Please sign in to comment.