summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDongsun Lee <ds73.lee@samsung.com>2019-02-22 13:15:36 +0900
committerDongsun Lee <ds73.lee@samsung.com>2019-02-22 13:15:36 +0900
commita22e8727811e6b4adfbd24659f58594ba11fb00c (patch)
tree10f423da594ef520ff79787f61a4424882284ffe
parent1034295a220b9ba25bd74296fcea05cbad39b57b (diff)
downloadkey-manager-a22e8727811e6b4adfbd24659f58594ba11fb00c.tar.gz
key-manager-a22e8727811e6b4adfbd24659f58594ba11fb00c.tar.bz2
key-manager-a22e8727811e6b4adfbd24659f58594ba11fb00c.zip
replace strcpy with strncpy for fixing SVACE(WGID=411075,411076)submit/tizen/20190222.041951accepted/tizen/unified/20190222.134051
Change-Id: I26207f412d5aeee68f6c90131d6c62978233c5f5 Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
-rw-r--r--src/manager/service/key-provider.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/manager/service/key-provider.cpp b/src/manager/service/key-provider.cpp
index e89af16..6049acb 100644
--- a/src/manager/service/key-provider.cpp
+++ b/src/manager/service/key-provider.cpp
@@ -249,7 +249,7 @@ void WrappedKeyAndInfoContainer::setKeyInfoClient(const std::string resized_clie
ThrowErr(Exc::InternalError, "Client name too long");
}
- strcpy(wrappedKeyAndInfo.keyInfo.client, resized_client.c_str());
+ strncpy(wrappedKeyAndInfo.keyInfo.client, resized_client.c_str(), resized_client.size());
}
void WrappedKeyAndInfoContainer::setKeyInfoSalt(const unsigned char *salt,
@@ -486,7 +486,7 @@ RawBuffer KeyProvider::generateDomainKEK(
if (user.size() >= sizeof(domainKEK.getKeyAndInfo().keyInfo.client)) {
ThrowErr(Exc::InternalError, "Client name too long");
}
- strcpy(domainKEK.getKeyAndInfo().keyInfo.client, user.c_str());
+ strncpy(domainKEK.getKeyAndInfo().keyInfo.client, user.c_str(), user.size());
return wrapDomainKEK(domainKEK, userPassword);
}