Message ID | CADT32eJZfdU0NnM3msbuG4Bpf9PgsDQhhknqhipnmwuTiiDfyA@mail.gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c index 4934347..aecb4a0 100644 --- a/fs/cifs/cifsencrypt.c +++ b/fs/cifs/cifsencrypt.c @@ -307,7 +307,8 @@ int calc_lanman_hash(const char *password, const char *crypt memset(password_with_pad, 0, CIFS_ENCPWD_SIZE); if (password) - strncpy(password_with_pad, password, CIFS_ENCPWD_SIZE); + strncpy(password_with_pad, password, + min_t(unsigned int, strlen(password), 14)); if (!encrypt && global_secflags & CIFSSEC_MAY_PLNTXT) { memcpy(lnm_session_key, password_with_pad,