fs/ntfs3: Add check for kmemdup
Since the kmemdup may return NULL pointer,
it should be better to add check for the return value
in order to avoid NULL pointer dereference.
Fixes: b46acd6a6a
("fs/ntfs3: Add NTFS journal")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
This commit is contained in:
parent
bfa434c601
commit
e6c3cef24c
@ -4256,6 +4256,10 @@ check_attribute_names:
|
||||
rec_len -= t32;
|
||||
|
||||
attr_names = kmemdup(Add2Ptr(lrh, t32), rec_len, GFP_NOFS);
|
||||
if (!attr_names) {
|
||||
err = -ENOMEM;
|
||||
goto out;
|
||||
}
|
||||
|
||||
lcb_put(lcb);
|
||||
lcb = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user