From b40a2fd7940a71041f8c0616b50724419108a5de Mon Sep 17 00:00:00 2001 From: tb <> Date: Wed, 6 Sep 2023 15:32:54 +0000 Subject: Avoid use-of-uninitialized in i2r_IPAddrBlocks() Reported by Viktor Szakats in https://github.com/libressl/portable/issues/910 ok job --- src/lib/libcrypto/x509/x509_addr.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/libcrypto/x509/x509_addr.c b/src/lib/libcrypto/x509/x509_addr.c index 2d8cc0b318..0506fe3a64 100644 --- a/src/lib/libcrypto/x509/x509_addr.c +++ b/src/lib/libcrypto/x509/x509_addr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_addr.c,v 1.86 2023/02/16 08:38:17 tb Exp $ */ +/* $OpenBSD: x509_addr.c,v 1.87 2023/09/06 15:32:54 tb Exp $ */ /* * Contributed to the OpenSSL Project by the American Registry for * Internet Numbers ("ARIN"). @@ -413,6 +413,13 @@ IPAddressFamily_afi_safi(const IPAddressFamily *af, uint16_t *out_afi, uint8_t safi = 0; int got_safi = 0; + if (out_afi != NULL) + *out_afi = 0; + if (out_safi != NULL) { + *out_safi = 0; + *safi_is_set = 0; + } + CBS_init(&cbs, af->addressFamily->data, af->addressFamily->length); if (!CBS_get_u16(&cbs, &afi)) -- cgit v1.2.3-55-g6feb