]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
runner.pm: apply minor correctness fix
authorViktor Szakats <commit@vsz.me>
Sat, 16 May 2026 16:58:47 +0000 (18:58 +0200)
committerViktor Szakats <commit@vsz.me>
Wed, 20 May 2026 01:14:26 +0000 (03:14 +0200)
"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

tests/runner.pm

index 4b6b12b0b87b2e45f3d9b4c5b1f9ac0a8f1f27a0..a3988009462e404ca038830e520aa56223326078 100644 (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;