Whamcloud - gitweb
LU-9245 utils: fix string copy handling within lgss_sk 65/26165/4
authorChris Hanna <hannac@iu.edu>
Thu, 23 Mar 2017 18:20:46 +0000 (14:20 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 6 Apr 2017 01:01:10 +0000 (01:01 +0000)
commit460ad9d609768e6d8182a2dfd1f24d5fcb0b3560
tree5fc647dd597cb7c56b0529164cef8cf6f4c5997b
parent738374be02d52ba10b44f4c4d4b335807eb48b46
LU-9245 utils: fix string copy handling within lgss_sk

Strings are not copied correctly when the fsname or nodemap field of
a shared key is replaced. Instead of being zero-terminated, the new
string may overlap the original if it is smaller.

Fixed by using the buffer length instead of the string length in
strncpy().

Change-Id: I17bb5aa0ca7c25b2545c17c6f23e69045730a547
Test-Parameters: trivial
Signed-off-by: Chris Hanna <hannac@iu.edu>
Reviewed-on: https://review.whamcloud.com/26165
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Kit Westneat <kit.westneat@gmail.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/utils/gss/lgss_sk.c