From 59fb1717a4b0feaec928a4ffed7f8dc55f048766 Mon Sep 17 00:00:00 2001 From: tb Date: Fri, 16 Jun 2023 11:20:01 +0000 Subject: [PATCH] Fix CRYPTO_get_ex_new_index() to return 1 or higher Mixing SSL_{get,set}_ex_data() and and SSL_{get,set}_app_data() in the same application causes problems since they both place their data at the same spot. From Marc Aldorasi ok jsing --- lib/libcrypto/ex_data.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libcrypto/ex_data.c b/lib/libcrypto/ex_data.c index b1e39136629..0a9c59121fd 100644 --- a/lib/libcrypto/ex_data.c +++ b/lib/libcrypto/ex_data.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_data.c,v 1.20 2018/03/17 16:20:01 beck Exp $ */ +/* $OpenBSD: ex_data.c,v 1.21 2023/06/16 11:20:01 tb Exp $ */ /* * Overhaul notes; @@ -320,7 +320,7 @@ def_get_class(int class_index) gen = malloc(sizeof(EX_CLASS_ITEM)); if (gen) { gen->class_index = class_index; - gen->meth_num = 0; + gen->meth_num = 1; gen->meth = sk_CRYPTO_EX_DATA_FUNCS_new_null(); if (!gen->meth) free(gen); -- 2.20.1