Browse files

MFC r253280:

Only copy as much bytes as there in superblock, instead of the full
block copy, when copying the superblock into the snapshot.  UFS1 does
not align superblock on the block boundary, and bcopy runs off the end
of the buffer.

Approved by:	re (hrs)
  • Loading branch information...
1 parent edf4181 commit 733c80745678d637b37fdb70457bd8062d2cf7d1 @kostikbel kostikbel committed Jul 19, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 sys/ufs/ffs/ffs_snapshot.c
2 sys/ufs/ffs/ffs_snapshot.c
@@ -790,7 +790,7 @@ ffs_snapshot(mp, snapfile)
} else {
loc = blkoff(fs, fs->fs_sblockloc);
- bcopy((char *)copy_fs, &nbp->b_data[loc], fs->fs_bsize);
+ bcopy((char *)copy_fs, &nbp->b_data[loc], (u_int)fs->fs_sbsize);

0 comments on commit 733c807

Please sign in to comment.