1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-27 11:55:06 +00:00

Use strlcpy(). I don't believe these are real problems but it's better

to use a safe idiom.

Reported by:	Coverity
CID:		1238914
MFC after:	1 week
This commit is contained in:
Xin LI 2014-09-25 22:22:54 +00:00
parent a2cf0c3c61
commit a6733ed126
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=272142

View File

@ -1249,7 +1249,7 @@ kvp_op_enumerate(struct hv_kvp_msg *op_msg, void *data __unused)
case IntegrationServicesVersion:
strcpy(key_name, "IntegrationServicesVersion");
strcpy(key_value, lic_version);
strlcpy(key_value, lic_version, HV_KVP_EXCHANGE_MAX_VALUE_SIZE);
break;
case NetworkAddressIPv4:
@ -1265,32 +1265,32 @@ kvp_op_enumerate(struct hv_kvp_msg *op_msg, void *data __unused)
break;
case OSBuildNumber:
strcpy(key_value, os_build);
strlcpy(key_value, os_build, HV_KVP_EXCHANGE_MAX_VALUE_SIZE);
strcpy(key_name, "OSBuildNumber");
break;
case OSName:
strcpy(key_value, os_name);
strlcpy(key_value, os_name, HV_KVP_EXCHANGE_MAX_VALUE_SIZE);
strcpy(key_name, "OSName");
break;
case OSMajorVersion:
strcpy(key_value, os_major);
strlcpy(key_value, os_major, HV_KVP_EXCHANGE_MAX_VALUE_SIZE);
strcpy(key_name, "OSMajorVersion");
break;
case OSMinorVersion:
strcpy(key_value, os_minor);
strlcpy(key_value, os_minor, HV_KVP_EXCHANGE_MAX_VALUE_SIZE);
strcpy(key_name, "OSMinorVersion");
break;
case OSVersion:
strcpy(key_value, os_build);
strlcpy(key_value, os_build, HV_KVP_EXCHANGE_MAX_VALUE_SIZE);
strcpy(key_name, "OSVersion");
break;
case ProcessorArchitecture:
strcpy(key_value, processor_arch);
strlcpy(key_value, processor_arch, HV_KVP_EXCHANGE_MAX_VALUE_SIZE);
strcpy(key_name, "ProcessorArchitecture");
break;