]> git.baikalelectronics.ru Git - kernel.git/commit
ksmbd: fix kfree of uninitialized pointer oid
authorColin Ian King <colin.king@canonical.com>
Fri, 18 Jun 2021 00:54:53 +0000 (09:54 +0900)
committerNamjae Jeon <namjae.jeon@samsung.com>
Fri, 18 Jun 2021 23:34:19 +0000 (08:34 +0900)
commit3d20263b7643a334d1f8d9c548b8e6bb8b808432
tree4815c84818802d5e426b925dc3b14b65321375a3
parent103e064380dcbb5b6ac94c27c16f8bc2e70658cf
ksmbd: fix kfree of uninitialized pointer oid

Currently function ksmbd_neg_token_init_mech_type can kfree an
uninitialized pointer oid when the call to asn1_oid_decode fails when
vlen is out of range. All the other failure cases in function
asn1_oid_decode set *oid to NULL on an error, so fix the issue by
ensuring the vlen out of range error also nullifies the pointer.

Addresses-Coverity: ("Uninitialized pointer read")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifsd/asn1.c