projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
56c762e
)
cifs: Skip any trailing backslashes from UNC
author
Paulo Alcantara
<
[email protected]
>
Wed, 14 Nov 2018 16:03:40 +0000
(14:03 -0200)
committer
Steve French
<
[email protected]
>
Mon, 24 Dec 2018 05:05:05 +0000
(23:05 -0600)
When extracting hostname from UNC, check for leading backslashes
before trying to remove them.
Signed-off-by: Paulo Alcantara <
[email protected]
>
Reviewed-by: Aurelien Aptel <
[email protected]
>
Signed-off-by: Steve French <
[email protected]
>
fs/cifs/connect.c
patch
|
blob
|
history
diff --git
a/fs/cifs/connect.c
b/fs/cifs/connect.c
index 944188d6200c246da16e68364bae713737a9c6a2..bab4422f58157fab2debcb176c5acbbc3cc7d7a5 100644
(file)
--- a/
fs/cifs/connect.c
+++ b/
fs/cifs/connect.c
@@
-1044,7
+1044,12
@@
extract_hostname(const char *unc)
/* skip double chars at beginning of string */
/* BB: check validity of these bytes? */
- src = unc + 2;
+ if (strlen(unc) < 3)
+ return ERR_PTR(-EINVAL);
+ for (src = unc; *src && *src == '\\'; src++)
+ ;
+ if (!*src)
+ return ERR_PTR(-EINVAL);
/* delimiter between hostname and sharename is always '\\' now */
delim = strchr(src, '\\');