]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/kstore: fix valgrind warning on fsid read
authorJianjian Huo <samuel.huo@gmail.com>
Tue, 16 Feb 2016 19:16:08 +0000 (14:16 -0500)
committerJianjian Huo <samuel.huo@gmail.com>
Tue, 16 Feb 2016 19:16:08 +0000 (14:16 -0500)
Signed-off-by: Jianjian Huo <samuel.huo@gmail.com>
src/os/kstore/KStore.cc

index 7de1b16fcf166cb63a614c44ff5abcbc81af512f..aba227d104976d3740082283e90a10f48f461f42 100644 (file)
@@ -722,6 +722,7 @@ int KStore::_open_fsid(bool create)
 int KStore::_read_fsid(uuid_d *uuid)
 {
   char fsid_str[40];
+  memset(fsid_str, 0, sizeof(fsid_str));
   int ret = safe_read(fsid_fd, fsid_str, sizeof(fsid_str));
   if (ret < 0) {
     derr << __func__ << " failed: " << cpp_strerror(ret) << dendl;