From 4365b1d358cd18c90d6371c96f5bc1a7516cd86b Mon Sep 17 00:00:00 2001 From: "Adam C. Emerson" Date: Tue, 8 May 2018 18:58:12 -0400 Subject: [PATCH] FuseStore: Expand buffers to prevent overflow Signed-off-by: Adam C. Emerson --- src/os/FuseStore.cc | 4 ++-- 1 file 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); -- 2.39.5