]> git.baikalelectronics.ru Git - kernel.git/commit
cifs: remove coverity warning in calc_lanman_hash
authorRonnie Sahlberg <lsahlber@redhat.com>
Wed, 12 Dec 2018 01:50:00 +0000 (11:50 +1000)
committerSteve French <stfrench@microsoft.com>
Mon, 24 Dec 2018 04:41:26 +0000 (22:41 -0600)
commit6260ddca8f28f3db977c0ff6b1a03b20a7f83a24
treec0507fb9cccea71689092398071e673d83daa991
parent6aefe05e243d72d88cd1f54e5ae88c22d80d232e
cifs: remove coverity warning in calc_lanman_hash

password_with_pad is a fixed size buffer of 16 bytes, it contains a
password string, to be padded with \0 if shorter than 16 bytes
but is just truncated if longer.
It is not, and we do not depend on it to be, nul terminated.

As such, do not use strncpy() to populate this buffer since
the str* prefix suggests that this is a string, which it is not,
and it also confuses coverity causing a false warning.

Detected by CoverityScan CID#113743 ("Buffer not null terminated")

Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/cifsencrypt.c