OSDN Git Service

staging: rtl8723bs: os_dep: Replace sprintf with scnprintf
authorCandy Febriyanto <cfebriyanto@gmail.com>
Mon, 1 Mar 2021 15:00:11 +0000 (22:00 +0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Mar 2021 08:25:32 +0000 (09:25 +0100)
commit6d108d064c27928d1bbae22c8f7f81d8efb021fb
tree8dea2930157916036e70636eff2b4a7459ecbf14
parent2a02059e4f9ed59817d8c238f93bb8e5c58562ad
staging: rtl8723bs: os_dep: Replace sprintf with scnprintf

The use of sprintf with format string here means that there is a risk
that the writes will go out of bounds, replace it with scnprintf.

In one block of the translate_scan function sprintf is only called once
(it's not being used to concatenate strings) so there is no need to keep
the pointer "p", remove it.

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Candy Febriyanto <cfebriyanto@gmail.com>
Link: https://lore.kernel.org/r/d76c5f1db8dbf02ac0ab954b0971ce24e5a8b9bd.1614610197.git.cfebriyanto@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8723bs/os_dep/ioctl_linux.c
drivers/staging/rtl8723bs/os_dep/mlme_linux.c