Skip to content

Fix segmentation fault caused by infinite recursion and unsafe array …#213

Merged
vaibhavpandeyvpz merged 2 commits into
vaibhavpandeyvpz:masterfrom
babkinvanya:fix-java-detection
Jan 4, 2026
Merged

Fix segmentation fault caused by infinite recursion and unsafe array …#213
vaibhavpandeyvpz merged 2 commits into
vaibhavpandeyvpz:masterfrom
babkinvanya:fix-java-detection

Conversation

@babkinvanya
Copy link
Copy Markdown
Contributor

…access

  • Fix infinite recursion in ProcessUtils::runCommand(): skip javaExe() call when searching for java via which/where commands to prevent recursive loop
  • Fix unsafe array access in VersionResolveWorker::resolve(): add isEmpty() check before accessing result.output[0] when checking Java version

The segfault occurred because runCommand() called javaExe() to set JAVA_HOME, which called findInPath() that called runCommand(which, java) again, creating an infinite recursion loop.

…access

- Fix infinite recursion in ProcessUtils::runCommand(): skip javaExe() call
  when searching for java via which/where commands to prevent recursive loop
- Fix unsafe array access in VersionResolveWorker::resolve(): add isEmpty()
  check before accessing result.output[0] when checking Java version

The segfault occurred because runCommand() called javaExe() to set JAVA_HOME,
which called findInPath() that called runCommand(which, java) again,
creating an infinite recursion loop.
@babkinvanya babkinvanya marked this pull request as draft January 1, 2026 22:31
@babkinvanya babkinvanya marked this pull request as ready for review January 1, 2026 22:38
@vaibhavpandeyvpz
Copy link
Copy Markdown
Owner

This should fix #212

@vaibhavpandeyvpz vaibhavpandeyvpz merged commit 2ba24dc into vaibhavpandeyvpz:master Jan 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants