aboutsummaryrefslogtreecommitdiff
path: root/src/crypto/pkcs7/pkcs7_x509.c
diff options
context:
space:
mode:
authorBoringSSL Robot <178796648329-compute@developer.gserviceaccount.com>2024-02-14 23:39:44 +0000
committerBoringSSL Robot <178796648329-compute@developer.gserviceaccount.com>2024-02-14 23:39:44 +0000
commit8ed092b54604624002a054bf10c34357f71e7a66 (patch)
tree1741a1f2c4781e0c6c9a4c09948736fb7f8a3694 /src/crypto/pkcs7/pkcs7_x509.c
parentb2254dc6314050238a77eac45699a11d46967acf (diff)
parent1b7fdbd9101dedc3e0aa3fcf4ff74eacddb34ecc (diff)
downloadboringssl-8ed092b54604624002a054bf10c34357f71e7a66.zip
boringssl-8ed092b54604624002a054bf10c34357f71e7a66.tar.gz
boringssl-8ed092b54604624002a054bf10c34357f71e7a66.tar.bz2
update chromium-stable-with-bazel from chromium-stable branch
Diffstat (limited to 'src/crypto/pkcs7/pkcs7_x509.c')
-rw-r--r--src/crypto/pkcs7/pkcs7_x509.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/crypto/pkcs7/pkcs7_x509.c b/src/crypto/pkcs7/pkcs7_x509.c
index fd71bd7..7b10f6f 100644
--- a/src/crypto/pkcs7/pkcs7_x509.c
+++ b/src/crypto/pkcs7/pkcs7_x509.c
@@ -237,11 +237,10 @@ int PKCS7_bundle_CRLs(CBB *out, const STACK_OF(X509_CRL) *crls) {
}
static PKCS7 *pkcs7_new(CBS *cbs) {
- PKCS7 *ret = OPENSSL_malloc(sizeof(PKCS7));
+ PKCS7 *ret = OPENSSL_zalloc(sizeof(PKCS7));
if (ret == NULL) {
return NULL;
}
- OPENSSL_memset(ret, 0, sizeof(PKCS7));
ret->type = OBJ_nid2obj(NID_pkcs7_signed);
ret->d.sign = OPENSSL_malloc(sizeof(PKCS7_SIGNED));
if (ret->d.sign == NULL) {
@@ -326,11 +325,10 @@ int i2d_PKCS7(const PKCS7 *p7, uint8_t **out) {
}
if (*out == NULL) {
- *out = OPENSSL_malloc(p7->ber_len);
+ *out = OPENSSL_memdup(p7->ber_bytes, p7->ber_len);
if (*out == NULL) {
return -1;
}
- OPENSSL_memcpy(*out, p7->ber_bytes, p7->ber_len);
} else {
OPENSSL_memcpy(*out, p7->ber_bytes, p7->ber_len);
*out += p7->ber_len;