提交 205179d0 编写于 作者: C Chen Gang 提交者: Greg Kroah-Hartman

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: NChen Gang <gang.chen@asianux.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 a85fd2c8
......@@ -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 );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册