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,
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);
}