提交 2920ee2b 编写于 作者: S Steve French

[CIFS] potential NULL dereference in parse_DFS_referrals()

memory allocation may fail, prevent a NULL dereference

Pointed out by Roel Kluin

CC: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: NSteve French <sfrench@us.ibm.com>
上级 7b2aa037
...@@ -3961,6 +3961,10 @@ parse_DFS_referrals(TRANSACTION2_GET_DFS_REFER_RSP *pSMBr, ...@@ -3961,6 +3961,10 @@ parse_DFS_referrals(TRANSACTION2_GET_DFS_REFER_RSP *pSMBr,
if (is_unicode) { if (is_unicode) {
__le16 *tmp = kmalloc(strlen(searchName)*2 + 2, __le16 *tmp = kmalloc(strlen(searchName)*2 + 2,
GFP_KERNEL); GFP_KERNEL);
if (tmp == NULL) {
rc = -ENOMEM;
goto parse_DFS_referrals_exit;
}
cifsConvertToUCS((__le16 *) tmp, searchName, cifsConvertToUCS((__le16 *) tmp, searchName,
PATH_MAX, nls_codepage, remap); PATH_MAX, nls_codepage, remap);
node->path_consumed = cifs_ucs2_bytes(tmp, node->path_consumed = cifs_ucs2_bytes(tmp,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册