diff --git a/cmd/zpool/os/linux/zpool_vdev_os.c b/cmd/zpool/os/linux/zpool_vdev_os.c index f194d28c5..862b1e619 100644 --- a/cmd/zpool/os/linux/zpool_vdev_os.c +++ b/cmd/zpool/os/linux/zpool_vdev_os.c @@ -87,7 +87,8 @@ typedef struct vdev_disk_db_entry { - char id[24]; + /* 24 byte name + 1 byte NULL terminator to make GCC happy */ + char id[25]; int sector_size; } vdev_disk_db_entry_t; diff --git a/module/zcommon/zfs_valstr.c b/module/zcommon/zfs_valstr.c index e2d4d1aef..f810d206c 100644 --- a/module/zcommon/zfs_valstr.c +++ b/module/zcommon/zfs_valstr.c @@ -38,7 +38,9 @@ */ typedef struct { const char vb_bit; - const char vb_pair[2]; + + /* 2 byte name + 1 byte NULL terminator to make GCC happy */ + const char vb_pair[3]; const char *vb_name; } valstr_bit_t; diff --git a/tests/zfs-tests/cmd/file/largest_file.c b/tests/zfs-tests/cmd/file/largest_file.c index d7252556b..4cf04a768 100644 --- a/tests/zfs-tests/cmd/file/largest_file.c +++ b/tests/zfs-tests/cmd/file/largest_file.c @@ -61,7 +61,7 @@ main(int argc, char **argv) offset_t llseek_ret = 0; int write_ret = 0; int err = 0; - char mybuf[5] = "aaaa\0"; + char mybuf[5] = "aaaa"; char *testfile; mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH; struct sigaction sa;