]> git.baikalelectronics.ru Git - kernel.git/commit
dm log writes: fix max length used for kstrndup
authorMa Shimiao <mashimiao.fnst@cn.fujitsu.com>
Tue, 12 Dec 2017 09:39:10 +0000 (17:39 +0800)
committerMike Snitzer <snitzer@redhat.com>
Wed, 17 Jan 2018 14:16:16 +0000 (09:16 -0500)
commit4b98593647a6c82e5a1cf3c496f3241948a220a9
tree948cf6d3629f6ce40f142532faaca9121c2d65f3
parent7d823739940ccb95bb02ba62663f23e15a3762ef
dm log writes: fix max length used for kstrndup

If source string is longer than max, kstrndup will allocate max+1
space.  So make sure the result will not exceed max.

Signed-off-by: Ma Shimiao <mashimiao.fnst@cn.fujitsu.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-log-writes.c