lkml.org 
[lkml]   [2023]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 2/2] staging: rtl8192e: Fix compiler warning truncated writing of iwe.u.name
iwe.u.name and proto_name have both 16 bytes of space. But when writing
to iwe.u.name the first 10 bytes are used by the fixed string
"IEEE802.11". Evaluating the code shows that only the following strings
can occur in proto_name: "N-24G", "g", "b", "bg". Therefore it is
sufficient to shorten proto_name to 6 bytes.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202309171733.Gl96cmYd-lkp@intel.com/
Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
drivers/staging/rtl8192e/rtllib_wx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtllib_wx.c b/drivers/staging/rtl8192e/rtllib_wx.c
index e9469bfef3dd..a37250de7ba3 100644
--- a/drivers/staging/rtl8192e/rtllib_wx.c
+++ b/drivers/staging/rtl8192e/rtllib_wx.c
@@ -29,7 +29,7 @@ static inline char *rtl819x_translate_scan(struct rtllib_device *ieee,
struct iw_request_info *info)
{
char custom[MAX_CUSTOM_LEN];
- char proto_name[IFNAMSIZ];
+ char proto_name[6];
char *pname = proto_name;
char *p;
struct iw_event iwe;
--
2.42.0
\
 
 \ /
  Last update: 2023-09-18 18:45    [W:0.053 / U:0.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site