runner.pm: apply minor correctness fix

"Lines 244-245 overwrite global variables `$runnerr` and `$runnerw` that
were already assigned in the child process (lines 205-206). In the
parent process context, these assignments appear incorrect and could
cause issues if `runner_init` is called multiple times. The parent
should only store references in the controller hashes."

It could never cause an actual issue, but clarifies the intent of the
code.

Spotted and fixed by GitHub Code Quality

Cherry-picked from #21646

Closes #21672
This commit is contained in:
Viktor Szakats 2026-05-16 18:58:47 +02:00
parent b3f76b21c9
commit 68e0b13209
No known key found for this signature in database

View file

@ -241,8 +241,10 @@ sub runner_init {
}
$controllerw{$thisrunnerid} = $thiscontrollerw;
$runnerr = $thisrunnerr;
$runnerw = $thisrunnerw;
if(!$multiprocess) {
$runnerr = $thisrunnerr;
$runnerw = $thisrunnerw;
}
$controllerr{$thisrunnerid} = $thiscontrollerr;
return $thisrunnerid;