mirror of
https://github.com/curl/curl.git
synced 2026-05-22 02:36:24 +03:00
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:
parent
b3f76b21c9
commit
68e0b13209
1 changed files with 4 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue