From 215d3ad0fe7d28bbce733165cc2b1ab7f94a36b6 Mon Sep 17 00:00:00 2001 From: tb Date: Tue, 18 Jun 2024 05:35:30 +0000 Subject: [PATCH] do_ext_i2d(): malloc -> calloc requested by jsing on review --- lib/libcrypto/x509/x509_conf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libcrypto/x509/x509_conf.c b/lib/libcrypto/x509/x509_conf.c index ed63f1c4d05..d7c1232831b 100644 --- a/lib/libcrypto/x509/x509_conf.c +++ b/lib/libcrypto/x509/x509_conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_conf.c,v 1.10 2024/06/18 05:34:09 tb Exp $ */ +/* $OpenBSD: x509_conf.c,v 1.11 2024/06/18 05:35:30 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -204,7 +204,7 @@ do_ext_i2d(const X509V3_EXT_METHOD *method, int ext_nid, int crit, if ((ext_len = method->i2d(ext_struc, NULL)) <= 0) goto merr; - if ((ext_der = malloc(ext_len)) == NULL) + if ((ext_der = calloc(1, ext_len)) == NULL) goto merr; p = ext_der; if (method->i2d(ext_struc, &p) != ext_len) -- 2.20.1