Commit 5308da8059 for openssl.org
commit 5308da80594827dce6c7a08b9777a7eaea780505
Author: sftcd <stephen.farrell@cs.tcd.ie>
Date: Tue Nov 25 22:41:23 2025 +0000
ech_read_priv_echconfiglist(): Pass encodedlen to BIO_new_mem_buf()
Fixes DEF-02-001
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
MergeDate: Wed Feb 11 17:19:08 2026
(Merged from https://github.com/openssl/openssl/pull/29593)
diff --git a/ssl/ech/ech_store.c b/ssl/ech/ech_store.c
index 0038a68f70..615cb45630 100644
--- a/ssl/ech/ech_store.c
+++ b/ssl/ech/ech_store.c
@@ -558,7 +558,7 @@ static int ech_read_priv_echconfiglist(OSSL_ECHSTORE *es, BIO *in,
binlen = encodedlen;
}
if (detfmt == OSSL_ECH_FMT_B64TXT) {
- btmp = BIO_new_mem_buf(encodedval, -1);
+ btmp = BIO_new_mem_buf(encodedval, (int)encodedlen);
if (btmp == NULL) {
ERR_raise(ERR_LIB_SSL, ERR_R_INTERNAL_ERROR);
goto err;