staging: wlags49_h2: buffer overflow setting station name
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 29 Oct 2013 20:00:15 +0000 (23:00 +0300)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 30 Oct 2013 19:24:49 +0000 (12:24 -0700)
commitb5e2f339865fb443107e5b10603e53bbc92dc054
tree1d6d0b95d4efb6894cfc1d7c13c731e287da4278
parentf856567b930dfcdbc3323261bf77240ccdde01f5
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>
drivers/staging/wlags49_h2/wl_priv.c