staging: rtl8192e: Replace sprintf with snprintf
PATCH 1/1 staging: rtl8192e: Replace sprintf with snprintf
Replace sprintf with snprintf as sprintf does not check for buffer overflow.
Signed-off-by Amitoj Kaur Chawla <[email protected]>
--- drivers/staging/rtl8192e/rtllib_wx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8192e/rtllib_wx.c +1 -1
@@ -602,7 +602,7 @@ int rtllib_wx_set_encode_ext(struct rtllib_device *ieee,char tempbuf[100 ];memset (tempbuf,0x00 ,100 ); -sprintf (tempbuf,"%s" , module); +snprintf (tempbuf,sizeof (tempbuf),"%s" , module);request_module ("%s" , tempbuf); ops =lib80211_get_crypto_ops (alg); }
Signature · 1 line
1.9.1
Greg KH
maintainerQuoted 13 lines · Amitoj Kaur Chawla
Replace sprintf with snprintf as sprintf does not check for buffer overflow.
Signed-off-by Amitoj Kaur Chawla <[email protected]>--- drivers/staging/rtl8192e/rtllib_wx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/rtl8192e/rtllib_wx.c +0
-0
drivers/staging/rtl8192e/rtllib_wx.c int rtllib_wx_set_encode_ext(struct rtllib_device *ieee, · line 605
Quoted 5 lines
drivers/staging/rtl8192e/rtllib_wx.c +1
-1@@ -602,7 +602,7 @@ int rtllib_wx_set_encode_ext(struct rtllib_device *ieee,char tempbuf[100 ];memset (tempbuf,0x00 ,100 ); -sprintf (tempbuf,"%s" , module); +snprintf (tempbuf,sizeof (tempbuf),"%s" , module);
But it's impossible to overflow this buffer, so sprintf() is the correct thing here. I can't take this change, sorry.
greg k-h