f2fs-tools: use pointer and memory alloaction instead of defining "structure stat...
authorIris Chang <iris.chang@mediatek.com>
Mon, 2 Apr 2018 07:59:24 +0000 (15:59 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Thu, 5 Apr 2018 05:22:33 +0000 (22:22 -0700)
commit865a3ead184e3d578b641eea90b4c68533f93ff5
tree6f00214496083698b281a70085faa8ef12920307
parentf7f93c754dd5d5799549e5ce34de38932095414a
f2fs-tools: use pointer and memory alloaction instead of defining "structure stat" in function stack

Problem:
Function f2fs_dev_is_unmounted() and get_device_info() define local
variable "struct stat xxx". If the callstack is very deep and stack
is smaller, it will result in stack corruption.

Solution:
It is better to use pointer and memory allocation instead of defining
"structure stat" in function stack.

Signed-off-by: Iris Chang <iris.chang@mediatek.com>
[Jaegeuk Kim: fix build errors.]
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
lib/libf2fs.c
mkfs/f2fs_format_utils.c