Skip to content

Commit

Permalink
02-test_errstr.t: make robust on openssl errstr crashes
Browse files Browse the repository at this point in the history
Reviewed-by: Tom Cosgrove <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
(Merged from openssl#23330)
  • Loading branch information
DDvO authored and t8m committed Jan 22, 2024
1 parent 7f7a910 commit ffda5af
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/recipes/02-test_errstr.t
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit ffda5af

Please sign in to comment.