Skip to content

Commit

Permalink
Fix error handling in pipelining test
Browse files Browse the repository at this point in the history
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 <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #21512)
  • Loading branch information
bernd-edlinger authored and t8m committed Jul 24, 2023
1 parent 7551264 commit 06a0d40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/sslapitest.c
Expand Up @@ -10851,7 +10851,7 @@ static int test_pipelining(int idx)
ENGINE_finish(e);
ENGINE_free(e);
OPENSSL_free(buf);
if (idx == 5)
if (fragsize == SSL3_RT_MAX_PLAIN_LENGTH)
OPENSSL_free(msg);
return testresult;
}
Expand Down

0 comments on commit 06a0d40

Please sign in to comment.