summaryrefslogtreecommitdiff
path: root/fs/cifs/smbencrypt.c
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2007-11-05 21:46:10 +0000
committerSteve French <sfrench@us.ibm.com>2007-11-05 21:46:10 +0000
commit63d2583f5a1a0b72fea3f2171f23f0ca8fa556ec (patch)
treeb9dab1514976c462f2d3528f86dd6c3e46fca745 /fs/cifs/smbencrypt.c
parentf1d662a7d5e5322e583aad6b3cfec03d8f27b435 (diff)
downloadlinux-exynos-63d2583f5a1a0b72fea3f2171f23f0ca8fa556ec.tar.gz
linux-exynos-63d2583f5a1a0b72fea3f2171f23f0ca8fa556ec.tar.bz2
linux-exynos-63d2583f5a1a0b72fea3f2171f23f0ca8fa556ec.zip
[CIFS] Fix walking out end of cifs dacl
Acked-by: Shirish Pargaonkar <shirishp@us.ibm.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/smbencrypt.c')
-rw-r--r--fs/cifs/smbencrypt.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/cifs/smbencrypt.c b/fs/cifs/smbencrypt.c
index bd3c4674f2ba..58bbfd992cc0 100644
--- a/fs/cifs/smbencrypt.c
+++ b/fs/cifs/smbencrypt.c
@@ -80,7 +80,7 @@ SMBencrypt(unsigned char *passwd, unsigned char *c8, unsigned char *p24)
/* Routines for Windows NT MD4 Hash functions. */
static int
-_my_wcslen(__u16 * str)
+_my_wcslen(__u16 *str)
{
int len = 0;
while (*str++ != 0)
@@ -96,7 +96,7 @@ _my_wcslen(__u16 * str)
*/
static int
-_my_mbstowcs(__u16 * dst, const unsigned char *src, int len)
+_my_mbstowcs(__u16 *dst, const unsigned char *src, int len)
{ /* BB not a very good conversion routine - change/fix */
int i;
__u16 val;
@@ -125,9 +125,9 @@ E_md4hash(const unsigned char *passwd, unsigned char *p16)
/* Password cannot be longer than 128 characters */
if (passwd) {
len = strlen((char *) passwd);
- if (len > 128) {
+ if (len > 128)
len = 128;
- }
+
/* Password must be converted to NT unicode */
_my_mbstowcs(wpwd, passwd, len);
} else
@@ -189,8 +189,10 @@ ntv2_owf_gen(const unsigned char owf[16], const char *user_n,
return;
dom_u = user_u + 1024;
- /* push_ucs2(NULL, user_u, user_n, (user_l+1)*2, STR_UNICODE|STR_NOALIGN|STR_TERMINATE|STR_UPPER);
- push_ucs2(NULL, dom_u, domain_n, (domain_l+1)*2, STR_UNICODE|STR_NOALIGN|STR_TERMINATE|STR_UPPER); */
+ /* push_ucs2(NULL, user_u, user_n, (user_l+1)*2,
+ STR_UNICODE|STR_NOALIGN|STR_TERMINATE|STR_UPPER);
+ push_ucs2(NULL, dom_u, domain_n, (domain_l+1)*2,
+ STR_UNICODE|STR_NOALIGN|STR_TERMINATE|STR_UPPER); */
/* BB user and domain may need to be uppercased */
user_l = cifs_strtoUCS(user_u, user_n, 511, nls_codepage);