projects
/
platform
/
upstream
/
f2fs-tools.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
689fd9b
)
fsck.f2fs: fix to avoid accessing invalid memory address
author
Chao Yu
<yuchao0@huawei.com>
Mon, 23 Apr 2018 06:01:45 +0000
(14:01 +0800)
committer
Jaegeuk Kim
<jaegeuk@kernel.org>
Sat, 14 Jul 2018 05:46:00 +0000
(22:46 -0700)
This patch adds to check return value of calloc in write_superblock().
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fsck/mount.c
patch
|
blob
|
history
diff --git
a/fsck/mount.c
b/fsck/mount.c
index
2ad78d1
..
0e67a6b
100644
(file)
--- a/
fsck/mount.c
+++ b/
fsck/mount.c
@@
-2234,6
+2234,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++) {