From ba91ca882d3b5aa4a82d584b18bca6e1202b7f8e Mon Sep 17 00:00:00 2001 From: tb Date: Tue, 28 Dec 2021 16:21:59 +0000 Subject: [PATCH] Add a comment so I don't forget to think about input validation in make_IPAddressFamily() --- lib/libcrypto/x509/x509_addr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/libcrypto/x509/x509_addr.c b/lib/libcrypto/x509/x509_addr.c index 244eea1f234..e66d408ffb3 100644 --- a/lib/libcrypto/x509/x509_addr.c +++ b/lib/libcrypto/x509/x509_addr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_addr.c,v 1.32 2021/12/28 16:10:47 tb Exp $ */ +/* $OpenBSD: x509_addr.c,v 1.33 2021/12/28 16:21:59 tb Exp $ */ /* * Contributed to the OpenSSL Project by the American Registry for * Internet Numbers ("ARIN"). @@ -774,6 +774,8 @@ make_IPAddressFamily(IPAddrBlocks *addr, const unsigned afi, if (!CBB_init(&cbb, 0)) goto err; + /* XXX - should afi <= 65535 and *safi < 255 be checked here? */ + if (!CBB_add_u16(&cbb, afi)) goto err; if (safi != NULL) { -- 2.20.1