]> www.infradead.org Git - mtd-utils.git/commit
mkfs.ubifs: Initialize 'cipher_name' as NULL
authorZhihao Cheng <chengzhihao1@huawei.com>
Sun, 4 Feb 2024 02:21:44 +0000 (10:21 +0800)
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Wed, 25 Sep 2024 07:08:41 +0000 (09:08 +0200)
commit8ade2c1776dc5e9c37cd1172031a02bfbdd07601
treeb03793b416bee833b109430ff22a6862eec90d3f
parent1ffb962afe2239ac02e3890df29653d84f07b104
mkfs.ubifs: Initialize 'cipher_name' as NULL

Variable 'cipher_name' is defined on stack without initialization, when
an user invokes mkfs with '--key' and without '-C', 'cipher_name' is a
random value, which could cause init_fscrypt_context() failed to find a
valid cipher.
Fix it by initializing 'cipher_name' as NULL when it is declared.

Fixes: cc4c5e295f546 ("mkfs.ubifs: Enable support for building without crypto")
Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com>
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
ubifs-utils/mkfs.ubifs/mkfs.ubifs.c