From: Adam C. Emerson Date: Tue, 8 May 2018 22:58:12 +0000 (-0400) Subject: FuseStore: Expand buffers to prevent overflow X-Git-Tag: v14.0.0~162^2~11 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4365b1d358cd18c90d6371c96f5bc1a7516cd86b;p=ceph.git FuseStore: Expand buffers to prevent overflow Signed-off-by: Adam C. Emerson --- diff --git a/src/os/FuseStore.cc b/src/os/FuseStore.cc index fb8af3aa2330..e8544180c050 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);