staging: wlags49_h2: buffer overflow setting station name

We need to check the length parameter before doing the memcpy().  I've
actually changed it to strlcpy() as well so that it's NUL terminated.

You need CAP_NET_ADMIN to trigger these so it's not the end of the
world.

Reported-by: Nico Golde <nico@ngolde.de>
Reported-by: Fabian Yamaguchi <fabs@goesec.de>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
int wvlan_uil_connect(struct uilreq *urq, struct wl_private *lp)
{
	int result = 0;
	/*------------------------------------------------------------------------*/


	DBG_FUNC("wvlan_uil_connect");
	DBG_ENTER(DbgInfo);


	if (!(lp->flags & WVLAN2_UIL_CONNECTED)) {
		lp->flags |= WVLAN2_UIL_CONNECTED;
		urq->hcfCtx = &(lp->hcfCtx);
		urq->result = UIL_SUCCESS;
	} else {
		DBG_WARNING(DbgInfo, "UIL_ERR_IN_USE\n");
		urq->result = UIL_ERR_IN_USE;
	}

	DBG_LEAVE(DbgInfo);
	return result;
} /* wvlan_uil_connect */

int wvlan_uil_connect(struct uilreq *urq, struct wl_private *lp)
{
	int result = 0;
	/*------------------------------------------------------------------------*/


	DBG_FUNC("wvlan_uil_connect");
	DBG_ENTER(DbgInfo);


	if (!(lp->flags & WVLAN2_UIL_CONNECTED)) {
		lp->flags |= WVLAN2_UIL_CONNECTED;
		urq->hcfCtx = &(lp->hcfCtx);
		urq->result = UIL_SUCCESS;
	} else {
		DBG_WARNING(DbgInfo, "UIL_ERR_IN_USE\n");
		urq->result = UIL_ERR_IN_USE;
	}

	DBG_LEAVE(DbgInfo);
	return result;
} /* wvlan_uil_connect */
