staging: wlags49_h2: strncpy, need checking the memory length
HCF_MAX_NAME_LEN is 32, which may less than ''probe_rsp->rawData[1]'', so need check the length when copy to ssid. Signed-off-by: Chen Gang <gang.chen@asianux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
a85fd2c8fd
commit
205179d0c0
1 changed files with 2 additions and 1 deletions
|
@ -3171,7 +3171,8 @@ void wl_process_mailbox( struct wl_private *lp )
|
||||||
|
|
||||||
memset( ssid, 0, sizeof( ssid ));
|
memset( ssid, 0, sizeof( ssid ));
|
||||||
strncpy( ssid, &probe_rsp->rawData[2],
|
strncpy( ssid, &probe_rsp->rawData[2],
|
||||||
probe_rsp->rawData[1] );
|
min(probe_rsp->rawData[1],
|
||||||
|
HCF_MAX_NAME_LEN - 1));
|
||||||
|
|
||||||
DBG_TRACE( DbgInfo, "(%s) SSID : %s\n",
|
DBG_TRACE( DbgInfo, "(%s) SSID : %s\n",
|
||||||
lp->dev->name, ssid );
|
lp->dev->name, ssid );
|
||||||
|
|
Loading…
Add table
Reference in a new issue