2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-06-20 02:21:05 +00:00

fix: reset newcmdstart between files in xcattest load_case

When a test case file is missing the end marker and the last line is a
cmd: directive, $newcmdstart stays set. The parser then appends lines
from the next file into the current command. If that next file is a
shell script (like simulatorctl.sh in the testcase tree), thousands of
lines of Perl/bash get concatenated and executed.

Reset $newcmdstart after closing each file to prevent state leaking
between files.

Fixes #5255
This commit is contained in:
Vinícius Ferrão
2026-04-26 15:21:29 -03:00
parent d017a941ca
commit 01150ac34b
+1
View File
@@ -1229,6 +1229,7 @@ sub load_case {
}
}
close($fd);
$newcmdstart = 0;
}
my @wrong_cases = ();