summaryrefslogtreecommitdiffstats
path: root/src/os/FuseStore.cc
diff options
context:
space:
mode:
authorAdam C. Emerson <aemerson@redhat.com>2018-05-09 00:58:12 +0200
committerAdam C. Emerson <aemerson@redhat.com>2018-05-09 19:26:29 +0200
commit4365b1d358cd18c90d6371c96f5bc1a7516cd86b (patch)
tree17762787e4e6c5c009eee934692f952515d6fc09 /src/os/FuseStore.cc
parentperfglue: Silence truncation warning (diff)
downloadceph-4365b1d358cd18c90d6371c96f5bc1a7516cd86b.tar.xz
ceph-4365b1d358cd18c90d6371c96f5bc1a7516cd86b.zip
FuseStore: Expand buffers to prevent overflow
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
Diffstat (limited to 'src/os/FuseStore.cc')
-rw-r--r--src/os/FuseStore.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/os/FuseStore.cc b/src/os/FuseStore.cc
index fb8af3aa233..e8544180c05 100644
--- a/src/os/FuseStore.cc
+++ b/src/os/FuseStore.cc
@@ -320,7 +320,7 @@ static int os_getattr(const char *path, struct stat *stbuf)
int bits = fs->store->collection_bits(ch);
if (bits < 0)
return -ENOENT;
- char buf[8];
+ char buf[12];
snprintf(buf, sizeof(buf), "%d\n", bits);
stbuf->st_size = strlen(buf);
}
@@ -630,7 +630,7 @@ static int os_open(const char *path, struct fuse_file_info *fi)
int r = fs->store->collection_bits(ch);
if (r < 0)
return r;
- char buf[8];
+ char buf[12];
snprintf(buf, sizeof(buf), "%d\n", r);
pbl = new bufferlist;
pbl->append(buf);