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:
Chen Gang 2013-04-26 18:31:58 +08:00 committed by Greg Kroah-Hartman
parent a85fd2c8fd
commit 205179d0c0

View File

@ -3171,7 +3171,8 @@ void wl_process_mailbox( struct wl_private *lp )
memset( ssid, 0, sizeof( ssid ));
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",
lp->dev->name, ssid );