cifs: replace various strncpy with strscpy and similar
authorRonnie Sahlberg <lsahlber@redhat.com>
Mon, 26 Aug 2019 23:30:14 +0000 (09:30 +1000)
committerSteve French <stfrench@microsoft.com>
Tue, 27 Aug 2019 22:25:12 +0000 (17:25 -0500)
commit340625e618e1b37a72a02f07aa7144ae0ab0b19e
tree9bac6626dd3e1477a93301a84c7c797b7db5526c
parent478228e57f81f6cb60798d54fc02a74ea7dd267e
cifs: replace various strncpy with strscpy and similar

Using strscpy is cleaner, and avoids some problems with
handling maximum length strings.  Linus noticed the
original problem and Aurelien pointed out some additional
problems. Fortunately most of this is SMB1 code (and
in particular the ASCII string handling older, which
is less common).

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/cifsproto.h
fs/cifs/cifssmb.c
fs/cifs/connect.c
fs/cifs/dir.c
fs/cifs/misc.c
fs/cifs/sess.c