From: Bernd Edlinger Date: Fri, 21 Jul 2023 05:34:39 +0000 (+0200) Subject: Fix error handling in pipelining test X-Git-Tag: openssl-3.2.0-alpha1~369 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=06a0d40322e96dbba816b35f82226871f635ec5a;p=thirdparty%2Fopenssl.git Fix error handling in pipelining test When an early error happens in the test_pipelining function and idx == 5 the error handling would try to call OPENSSL_free(msg), but msg is at that time just a string constant in read-only memory, so a crash would be the result. Fixed that by using fragsize as an indication when to free msg. Reviewed-by: Tom Cosgrove Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/21512) --- diff --git a/test/sslapitest.c b/test/sslapitest.c index 28ed079fd6f..f29f1289c98 100644 --- a/test/sslapitest.c +++ b/test/sslapitest.c @@ -10851,7 +10851,7 @@ end: ENGINE_finish(e); ENGINE_free(e); OPENSSL_free(buf); - if (idx == 5) + if (fragsize == SSL3_RT_MAX_PLAIN_LENGTH) OPENSSL_free(msg); return testresult; }