summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortb <>2024-06-18 05:35:30 +0000
committertb <>2024-06-18 05:35:30 +0000
commit4a78fe226ccc6723fec3007137fbf245ed54709b (patch)
treef6dc8702b80d887a87b6d26dfd5dfa5bd8187d33 /src
parent70e06affe95d9ac3db63164704320cebfad67e8b (diff)
downloadopenbsd-4a78fe226ccc6723fec3007137fbf245ed54709b.tar.gz
openbsd-4a78fe226ccc6723fec3007137fbf245ed54709b.tar.bz2
openbsd-4a78fe226ccc6723fec3007137fbf245ed54709b.zip
do_ext_i2d(): malloc -> calloc
requested by jsing on review
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/x509/x509_conf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libcrypto/x509/x509_conf.c b/src/lib/libcrypto/x509/x509_conf.c
index ed63f1c4d0..d7c1232831 100644
--- a/src/lib/libcrypto/x509/x509_conf.c
+++ b/src/lib/libcrypto/x509/x509_conf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_conf.c,v 1.10 2024/06/18 05:34:09 tb Exp $ */ 1/* $OpenBSD: x509_conf.c,v 1.11 2024/06/18 05:35:30 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 1999. 3 * project 1999.
4 */ 4 */
@@ -204,7 +204,7 @@ do_ext_i2d(const X509V3_EXT_METHOD *method, int ext_nid, int crit,
204 204
205 if ((ext_len = method->i2d(ext_struc, NULL)) <= 0) 205 if ((ext_len = method->i2d(ext_struc, NULL)) <= 0)
206 goto merr; 206 goto merr;
207 if ((ext_der = malloc(ext_len)) == NULL) 207 if ((ext_der = calloc(1, ext_len)) == NULL)
208 goto merr; 208 goto merr;
209 p = ext_der; 209 p = ext_der;
210 if (method->i2d(ext_struc, &p) != ext_len) 210 if (method->i2d(ext_struc, &p) != ext_len)