mtd: sm_ftl: heap corruption in sm_create_sysfs_attributes()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 5 Dec 2013 14:53:50 +0000 (17:53 +0300)
committerJiri Slaby <jslaby@suse.cz>
Thu, 15 May 2014 07:56:11 +0000 (09:56 +0200)
commit16a7c07c715dc5d8b764b2c3cae3b43117c01de3
treea81989366703774bffe90e2f513729907faeba60
parenta46c32362ed74b19462c553604726e271c89b01f
mtd: sm_ftl: heap corruption in sm_create_sysfs_attributes()

commit b4c233057771581698a13694ab6f33b48ce837dc upstream.

We always put a NUL terminator one space past the end of the "vendor"
buffer.  Walter Harms also pointed out that this should just use
kstrndup().

Fixes: 7d17c02a01a1 ('mtd: Add new SmartMedia/xD FTL')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/mtd/sm_ftl.c