]> git.karo-electronics.de Git - karo-tx-linux.git/commit
thermal: fix potential out-of-bounds memory access
authorGuenter Roeck <linux@roeck-us.net>
Sat, 21 Jul 2012 00:53:48 +0000 (10:53 +1000)
committerZhang Rui <rui.zhang@intel.com>
Thu, 9 Aug 2012 01:11:12 +0000 (09:11 +0800)
commit372f46d78a129553d34a9f53bc2ed8ae5cdac915
tree6f504185a9163695adfe87ae07dcc72694cb36c8
parentef234eec59f9fc50724271c9ee9c858b1de0eb77
thermal: fix potential out-of-bounds memory access

temp_crit.name and temp_input.name have a length of 16 bytes.  Using
THERMAL_NAME_LENGTH (20) as length parameter for snprintf() may result in
out-of-bounds memory accesses.  Replace it with sizeof().

Addresses Coverity #115679

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Cc: Len Brown <lenb@kernel.org>
Cc: "Brown, Len" <len.brown@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/thermal/thermal_sys.c