Home Home > GIT Browse > stable
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-03-18 07:50:55 +0100
committerJiri Slaby <jslaby@suse.cz>2019-03-18 07:50:55 +0100
commit1fd1e64f3c1a0c32b0e4ce8b5ba09aed0ec0993b (patch)
tree7e755789c9d8379505cc1f58f0390bbd15865407
parent51228f3f65d40041123937b685a8e81dca9078dd (diff)
cifs: Fix NULL pointer dereference of devname (bnc#1129519).stable
-rw-r--r--fs/cifs/connect.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 8463c940e0e5..2ed773b395a4 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1486,6 +1486,11 @@ cifs_parse_devname(const char *devname, struct smb_vol *vol)
const char *delims = "/\\";
size_t len;
+ if (unlikely(!devname || !*devname)) {
+ cifs_dbg(VFS, "Device name not specified.\n");
+ return -EINVAL;
+ }
+
/* make sure we have a valid UNC double delimiter prefix */
len = strspn(devname, delims);
if (len != 2)