Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cluster: only assign debug port if in valid range.
See: nodejs#8159 Per above discussion, cluster.fork() currently sends --debug-port to forked processes regardless of whether debug is enabled, and more importantly, without any bounds checking. This will rather unexpectedly crash and Node process that forks enough times. This patch simply bounds checks --debug-port and doesn't set arg if out of bounds (V8 requires 1024 < debug-port < 65535). This will prevent surprises to callers of cluster.fork() while waiting for the debug part of node to be rewritten as mentioned in issue discussion above.
- Loading branch information