From 78db451b2f1581c884d2cfc809ee3bde9cc1c3a6 Mon Sep 17 00:00:00 2001 From: tb Date: Wed, 26 Jun 2024 03:39:49 +0000 Subject: [PATCH] tls_extension_find(): make output index optional suggested by jsing --- lib/libssl/ssl_tlsext.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/libssl/ssl_tlsext.c b/lib/libssl/ssl_tlsext.c index 64f82b7dfb5..95174dc805d 100644 --- a/lib/libssl/ssl_tlsext.c +++ b/lib/libssl/ssl_tlsext.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl_tlsext.c,v 1.151 2024/06/25 05:46:48 tb Exp $ */ +/* $OpenBSD: ssl_tlsext.c,v 1.152 2024/06/26 03:39:49 tb Exp $ */ /* * Copyright (c) 2016, 2017, 2019 Joel Sing * Copyright (c) 2017 Doug Hogan @@ -2368,7 +2368,8 @@ tls_extension_find(uint16_t type, size_t *tls_extensions_idx) for (i = 0; i < N_TLS_EXTENSIONS; i++) { if (tls_extensions[i].type == type) { - *tls_extensions_idx = i; + if (tls_extensions_idx != NULL) + *tls_extensions_idx = i; return &tls_extensions[i]; } } -- 2.20.1