cifs: fix NULL dereference in match_prepath
authorRonnie Sahlberg <lsahlber@redhat.com>
Wed, 22 Jan 2020 01:07:56 +0000 (11:07 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Feb 2020 07:34:51 +0000 (08:34 +0100)
commit35c9bcb672e36fc64b84b1b7b3b8ff93c8b6cc49
tree1de7c6d536654ba8c472ec15fe463750de819a5a
parentd84a6da925fa9462a088f4af21c39722b419f9b3
cifs: fix NULL dereference in match_prepath

[ Upstream commit fe1292686333d1dadaf84091f585ee903b9ddb84 ]

RHBZ: 1760879

Fix an oops in match_prepath() by making sure that the prepath string is not
NULL before we pass it into strcmp().

This is similar to other checks we make for example in cifs_root_iget()

Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/cifs/connect.c