CID 966632 (#1 of 1): Copy into fixed size buffer (STRING_OVERFLOW)
2. fixed_size_dest: You might overrun the 200 byte fixed-size string
"path" by copying "args[0UL]" without checking the length.
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
finisher = new Finisher(g_ceph_context);
if (!args.empty()) {
- strcpy(path, args[0]);
+ size_t copy_len = std::min(sizeof(path)-1, strlen(args[0]));
+ strncpy(path, args[0], copy_len);
+ path[copy_len] = '\0';
} else {
srand(getpid()+time(0));
snprintf(path, sizeof(path), "/tmp/ceph_test_filejournal.tmp.%d", rand());