* tests/scripts/functions/shell: [SV 65323] Run huge var test in bash

The long variable name causes ksh to crash.  Some systems use ksh as
/bin/sh, so force bash if it's available else skip the test.
This commit is contained in:
Dmitry Goncharov 2024-04-21 13:35:33 -04:00 committed by Paul Smith
parent 40664fef1f
commit e3f938caf8

View File

@ -213,12 +213,15 @@ endif
'--no-print-directory -j2', ": 2\n: 1");
}
if ($port_type eq 'UNIX') {
# sv 65323. Check for bash, because such long variable name causes ksh to
# segfault.
if (-x '/bin/bash') {
# sv 65172.
# Buffer overrun in recursively_expand_for_file on a variable with a long
# name.
my $v = "a1234567890" x 4 x 1000;
run_make_test("
SHELL:=/bin/bash
export $v=\$(shell echo hello)
all:; \@echo \$\$$v
", '', "hello\n");