]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
BtrfsFileStoreBackend.cc: fix string overflow 2623/head
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 1 Oct 2014 21:08:15 +0000 (23:08 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Wed, 1 Oct 2014 21:08:15 +0000 (23:08 +0200)
commit3374a0b227ad0b26098cdf1e2d5ad7978723c77f
treea83ac53e562255725c8944ec6397ee323ea150ec
parent8b7fc61c44825a6f16d642b218d5ca02f723c4c5
BtrfsFileStoreBackend.cc: fix string overflow

Use strncpy() instead of strcpy and make sure the result
is '\0' terminated.

Fix for:

CID 1063700 (#1 of 1): Copy into fixed size buffer (STRING_OVERFLOW)
 fixed_size_dest: You might overrun the 4088 byte fixed-size string
 vol_args.name by copying the return value of c_str without checking
 the length.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/os/BtrfsFileStoreBackend.cc