Skip to content

Commit

Permalink
Avoid use-of-uninitialized in i2r_IPAddrBlocks()
Browse files Browse the repository at this point in the history
Reported by Viktor Szakats in
libressl/portable#910

ok job
  • Loading branch information
botovq committed Sep 6, 2023
1 parent 749900e commit d1c8496
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/libcrypto/x509/x509_addr.c
Original file line number Diff line number Diff line change
@@ -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").
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit d1c8496

Please sign in to comment.