]> git.baikalelectronics.ru Git - kernel.git/commit
hostap: fixup strlen() math
authorDan Carpenter <error27@gmail.com>
Sat, 10 Jul 2010 22:10:42 +0000 (00:10 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 12 Jul 2010 20:05:32 +0000 (16:05 -0400)
commit61bbdec1143ed897f309415699870c08de75413c
tree341131276969b7ee62c8de5d40e6d6367f5874d1
parent21c50529eb97348ae7c74ed6d711f217307af500
hostap: fixup strlen() math

In hostap_add_interface() we do:
sprintf(dev->name, "%s%s", prefix, name);

dev->name has IFNAMSIZ (16) characters.
prefix is local->dev->name.
name is "wds%d"

strlen() returns the number of characters in the string not counting the
NULL so if we have a string with 11 characters we get "12345678901wds%d"
which is 16 characters and a NULL so we're past the end of the array.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/hostap/hostap_main.c