]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
FuseStore: Expand buffers to prevent overflow
authorAdam C. Emerson <aemerson@redhat.com>
Tue, 8 May 2018 22:58:12 +0000 (18:58 -0400)
committerNathan Cutler <ncutler@suse.com>
Fri, 18 May 2018 13:30:35 +0000 (15:30 +0200)
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
(cherry picked from commit 4365b1d358cd18c90d6371c96f5bc1a7516cd86b)

src/os/FuseStore.cc

index fb8af3aa2330d68bdf15ed448d0136a5a9f1ef87..e8544180c050c6f22600c075162cba8cfec5bb46 100644 (file)
@@ -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);