[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1407000807.1835.14.camel@joe-AO725>
Date: Sat, 02 Aug 2014 10:33:27 -0700
From: Joe Perches <joe@...ches.com>
To: Shirish Pargaonkar <shirishpargaonkar@...il.com>
Cc: Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>,
Steve French <sfrench@...ba.org>,
linux-cifs <linux-cifs@...r.kernel.org>,
samba-technical <samba-technical@...ts.samba.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] fs: cifs: cifsencrypt.c: Cleaning up missing
null-terminate in conjunction with strncpy
On Sat, 2014-08-02 at 11:55 -0500, Shirish Pargaonkar wrote:
> Acked-by: Shirish Pargaonkar <spargaonkar@...e.com>
[]
> > diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c
[]
> > @@ -307,7 +307,7 @@ int calc_lanman_hash(const char *password, const char *cryptkey, bool encrypt,
> >
> > memset(password_with_pad, 0, CIFS_ENCPWD_SIZE);
> > if (password)
> > - strncpy(password_with_pad, password, CIFS_ENCPWD_SIZE);
> > + strncpy(password_with_pad, password, CIFS_ENCPWD_SIZE - 1);
Is this always correct?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists