From: Randall S. Becker Date: Thu, 7 Sep 2023 19:42:10 +0000 (+0100) Subject: Prevent 80-test_cmp_http from accidentally killing perl in error. X-Git-Tag: openssl-3.2.0-alpha2~109 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c499cbc3239e3ac93fa5acf85cec7ea7df116518;p=thirdparty%2Fopenssl.git Prevent 80-test_cmp_http from accidentally killing perl in error. If there is an issue with setting up the test environment in this test, pid is not set so stop_server kills the perl process. A guard has been added to prevent this situation. Fixes: #22014 Signed-off-by: Randall S. Becker Reviewed-by: Richard Levitte Reviewed-by: Tom Cosgrove Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/22015) --- diff --git a/test/recipes/80-test_cmp_http.t b/test/recipes/80-test_cmp_http.t index bd4df0dd0dc..62ce1bd1690 100644 --- a/test/recipes/80-test_cmp_http.t +++ b/test/recipes/80-test_cmp_http.t @@ -314,7 +314,7 @@ sub start_server { $server_host = "127.0.0.1" if $server_host eq "0.0.0.0"; } unless ($server_port > 0) { - stop_server($server_name, $pid); + stop_server($server_name, $pid) if $pid; print "Cannot get expected output from the $server_name server"; return 0; }