]> git.baikalelectronics.ru Git - kernel.git/commit
cifs: replace snprintf with scnprintf
authorRonnie Sahlberg <lsahlber@redhat.com>
Fri, 8 Feb 2019 23:51:11 +0000 (09:51 +1000)
committerSteve French <stfrench@microsoft.com>
Tue, 5 Mar 2019 02:05:34 +0000 (20:05 -0600)
commitf79d28586d2cbc18585c665eebe3d4ca627ec961
treee747c396f31c53f13a0de32c008e1ac1ce6cf7c3
parent52cd2aa49d5b27dfb5cbf4ed1d5eee2fda5b692c
cifs: replace snprintf with scnprintf

a trivial patch that replaces all use of snprintf with scnprintf.
scnprintf() is generally seen as a safer function to use than
snprintf for many use cases.

In our case, there is no actual difference between the two since we never
look at the return value. Thus we did not have any of the bugs that
scnprintf protects against and the patch does nothing.

However, for people reading our code it will be a receipt that we
have done our due dilligence and checked our code for this type of bugs.

See the presentation "Making C Less Dangerous In The Linux Kernel"
at this years LCA

Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/cifssmb.c
fs/cifs/connect.c
fs/cifs/link.c
fs/cifs/smb2pdu.c
fs/cifs/smbdirect.c