{
auto it = m_certificateMap.find(certificate.privateHandler);
- if (it == m_certificateMap.end()) {
+ if (it == m_certificateMap.end() || location == nullptr) {
return CERTSVC_WRONG_ARGUMENT;
}
CertSvcCertificate *certificate)
{
try {
+ if (location == nullptr)
+ return CERTSVC_FAIL;
+
CertificatePtr cert = Certificate::createFromFile(location);
certificate->privateInstance = instance;
certificate->privateHandler = impl(instance)->addCert(cert);
}
BinaryQueueAutoPtr result(new BinaryQueue());
+ if (bufferCopy.Get() == nullptr)
+ return BinaryQueueAutoPtr();
+
Flatten(bufferCopy.Get(), available);
result->AppendUnmanaged(
bufferCopy.Get(), available, &BufferDeleterFree, NULL);
case ERANGE:
// Incease buffer size and retry
- size <<= 1;
+ if ((1UL << 31) > size)
+ size <<= 1;
continue;
default:
makeCertificateFromMemory(instance, ServerCertInfo::FullFieldCertPem, certificate);
result = certsvc_certificate_save_file(certificate, location);
- BOOST_CHECK_EQUAL(result, CERTSVC_FAIL);
+ BOOST_CHECK_EQUAL(result, CERTSVC_WRONG_ARGUMENT);
certsvc_certificate_free(certificate);
certsvc_instance_free(instance);