]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #12515 from kylinstorage/wip-safe-trace
authorJohn Spray <jspray@redhat.com>
Mon, 9 Jan 2017 10:29:47 +0000 (10:29 +0000)
committerGitHub <noreply@github.com>
Mon, 9 Jan 2017 10:29:47 +0000 (10:29 +0000)
client: fix potential buffer overflow

Reviewed-by: Sage Weil <sage@redhat.com>
1  2 
src/client/SyntheticClient.cc

index 73024ff4842ebc2330ae61b1197616ae52118e07,b28f077b0de6c96ff5d76aaafd0748a70ae8e78c..234a1b202777f089b533bb218720b2de9d550a47
@@@ -1005,10 -1004,10 +1005,10 @@@ int SyntheticClient::play_trace(Trace& 
    UserPerm perms = client->pick_my_perms();
    t.start();
  
-   char buf[1024];
-   char buf2[1024];
+   string buf;
+   string buf2;
  
 -  utime_t start = ceph_clock_now(client->cct);
 +  utime_t start = ceph_clock_now();
  
    ceph::unordered_map<int64_t, int64_t> open_files;
    ceph::unordered_map<int64_t, dir_result_t*> open_dirs;