]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Prevent 80-test_cmp_http from accidentally killing perl in error.
authorRandall S. Becker <randall.becker@nexbridge.ca>
Thu, 7 Sep 2023 19:42:10 +0000 (20:42 +0100)
committerPauli <pauli@openssl.org>
Sun, 10 Sep 2023 23:08:35 +0000 (09:08 +1000)
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 <randall.becker@nexbridge.ca>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22015)

test/recipes/80-test_cmp_http.t

index bd4df0dd0dc2c9e4b96a340457e0047877b1e7e9..62ce1bd169063e227170a30a199e7731f4f7eafa 100644 (file)
@@ -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;
     }