diff options
author | tb <> | 2023-09-06 15:32:54 +0000 |
---|---|---|
committer | tb <> | 2023-09-06 15:32:54 +0000 |
commit | b40a2fd7940a71041f8c0616b50724419108a5de (patch) | |
tree | 87898ea166478c80a82c9fa1b74194351a3a3a37 | |
parent | 04898380cd1589bda4de087c73a62e2db1be259f (diff) | |
download | openbsd-b40a2fd7940a71041f8c0616b50724419108a5de.tar.gz openbsd-b40a2fd7940a71041f8c0616b50724419108a5de.tar.bz2 openbsd-b40a2fd7940a71041f8c0616b50724419108a5de.zip |
Avoid use-of-uninitialized in i2r_IPAddrBlocks()
Reported by Viktor Szakats in
https://github.com/libressl/portable/issues/910
ok job
-rw-r--r-- | src/lib/libcrypto/x509/x509_addr.c | 9 |
1 files changed, 8 insertions, 1 deletions
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 @@ | |||
1 | /* $OpenBSD: x509_addr.c,v 1.86 2023/02/16 08:38:17 tb Exp $ */ | 1 | /* $OpenBSD: x509_addr.c,v 1.87 2023/09/06 15:32:54 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Contributed to the OpenSSL Project by the American Registry for | 3 | * Contributed to the OpenSSL Project by the American Registry for |
4 | * Internet Numbers ("ARIN"). | 4 | * Internet Numbers ("ARIN"). |
@@ -413,6 +413,13 @@ IPAddressFamily_afi_safi(const IPAddressFamily *af, uint16_t *out_afi, | |||
413 | uint8_t safi = 0; | 413 | uint8_t safi = 0; |
414 | int got_safi = 0; | 414 | int got_safi = 0; |
415 | 415 | ||
416 | if (out_afi != NULL) | ||
417 | *out_afi = 0; | ||
418 | if (out_safi != NULL) { | ||
419 | *out_safi = 0; | ||
420 | *safi_is_set = 0; | ||
421 | } | ||
422 | |||
416 | CBS_init(&cbs, af->addressFamily->data, af->addressFamily->length); | 423 | CBS_init(&cbs, af->addressFamily->data, af->addressFamily->length); |
417 | 424 | ||
418 | if (!CBS_get_u16(&cbs, &afi)) | 425 | if (!CBS_get_u16(&cbs, &afi)) |