diff options
author | Dr. David von Oheimb <dev@ddvo.net> | 2024-01-18 14:46:17 +0100 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2024-01-22 10:06:55 +0100 |
commit | ffda5af359ed024c64e02c692b589f4fe47b0fc5 (patch) | |
tree | 09f2be6e9ce54719878a0c521ff91543caa856bf | |
parent | 7f7a910b6e8d5e564f5ce174236e44de0725f801 (diff) |
02-test_errstr.t: make robust on `openssl errstr` crashes
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23330)
-rw-r--r-- | test/recipes/02-test_errstr.t | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/recipes/02-test_errstr.t b/test/recipes/02-test_errstr.t index 396d273176..61adc83e58 100644 --- a/test/recipes/02-test_errstr.t +++ b/test/recipes/02-test_errstr.t @@ -134,8 +134,9 @@ sub match_opensslerr_reason { my @strings = @_; my $errcode_hex = sprintf "%x", $errcode; - my $reason = - ( run(app([ qw(openssl errstr), $errcode_hex ]), capture => 1) )[0]; + my @res = run(app([ qw(openssl errstr), $errcode_hex ]), capture => 1); + return 0 unless $#res >= 0; + my $reason = $res[0]; $reason =~ s|\R$||; $reason = ( split_error($reason) )[3]; |