tests/runner: only allow [!A-Za-z0-9_-] in %if feature names

... in the %if preprocessor parser.

This guards against accidentally getting a carriage-return part of the
feature name.

Fixes #14403
Closes #14411
This commit is contained in:
Daniel Stenberg 2024-08-06 14:34:33 +02:00
parent b0394b1535
commit 48818a41af
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -307,7 +307,7 @@ sub prepro {
for my $s (@entiretest) {
my $f = $s;
$line++;
if($s =~ /^ *%if (.*)/) {
if($s =~ /^ *%if ([A-Za-z0-9!_-]*)/) {
my $cond = $1;
my $rev = 0;