fsck.f2fs: fix to avoid accessing invalid memory address
PATCH 1/1 fsck.f2fs: fix to avoid accessing invalid memory address
This patch adds to check return value of calloc in write_superblock().
Signed-off-by Chao Yu <[email protected]>
--- fsck/mount.c | 1 + 1 file changed, 1 insertion(+)
fsck/mount.c +1 -0
@@ -2155,6 +2155,7 @@ void write_superblock(struct f2fs_super_block *new_sb)u_int8_t *buf; buf =calloc (BLOCK_SZ ,1 ); +ASSERT (buf);memcpy (buf +F2FS_SUPER_OFFSET , new_sb,sizeof (*new_sb));for (index =0 ; index <2 ; index++) {
Signature · 1 line
2.15.0.55.gc2ece9dc4de6