1
0
mirror of https://github.com/ceph/ceph synced 2025-03-31 16:25:56 +00:00

Merge pull request from ceph/wip-coverity-respawn

mds: make strncpy in ::respawn safer

Reviewed-by: Sage Weil <sage@inktank.com>
This commit is contained in:
Sage Weil 2014-04-22 08:37:21 -07:00
commit f244109cb7

View File

@ -1711,7 +1711,7 @@ void MDS::respawn()
dout(1) << " cwd " << cwd << dendl;
/* Fall back to a best-effort: just running in our CWD */
strncpy(exe_path, orig_argv[0], sizeof(exe_path));
strncpy(exe_path, orig_argv[0], sizeof(exe_path) - 1);
}
dout(1) << " exe_path " << exe_path << dendl;