mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 04:12:04 -04:00
cifs: prevent NULL deref in cifs_compose_mount_options()
[ Upstream commit 03313d1c3a2f086bb60920607ab79ac8f8578306 ]
The optional @ref parameter might contain an NULL node_name, so
prevent dereferencing it in cifs_compose_mount_options().
Addresses-Coverity: 1476408 ("Explicit null dereferenced")
Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
06d8a7eb58
commit
f7d1fa65e7
1 changed files with 3 additions and 0 deletions
|
|
@ -151,6 +151,9 @@ char *cifs_compose_mount_options(const char *sb_mountdata,
|
|||
return ERR_PTR(-EINVAL);
|
||||
|
||||
if (ref) {
|
||||
if (WARN_ON_ONCE(!ref->node_name || ref->path_consumed < 0))
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
if (strlen(fullpath) - ref->path_consumed) {
|
||||
prepath = fullpath + ref->path_consumed;
|
||||
/* skip initial delimiter */
|
||||
|
|
|
|||
Loading…
Reference in a new issue