mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
cov: use dm_strncpy variant
This commit is contained in:
parent
cb16f5053f
commit
2a8c195360
@ -41,7 +41,7 @@ int create_temp_name(const char *dir, char *buffer, size_t len, int *fd,
|
||||
pid = getpid();
|
||||
if (gethostname(hostname, sizeof(hostname)) < 0) {
|
||||
log_sys_error("gethostname", "");
|
||||
strcpy(hostname, "nohostname");
|
||||
dm_strncpy(hostname, "nohostname", sizeof(hostname));
|
||||
} else {
|
||||
/* Replace any '/' with '?' found in the hostname. */
|
||||
p = hostname;
|
||||
|
@ -676,11 +676,11 @@ static int _daemon_parms_init(struct cmd_context *cmd, struct daemon_parms *parm
|
||||
|
||||
memset(parms->devicesfile, 0, sizeof(parms->devicesfile));
|
||||
if (cmd->devicesfile) {
|
||||
if (strlen(cmd->devicesfile) >= sizeof(parms->devicesfile)) {
|
||||
if (!_dm_strncpy(parms->devicesfile, cmd->devicesfile,
|
||||
sizeof(parms->devicesfile))) {
|
||||
log_error("devicefile name too long for lvmpolld");
|
||||
return 0;
|
||||
}
|
||||
strcpy(parms->devicesfile, cmd->devicesfile);
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
Loading…
Reference in New Issue
Block a user