Commit 2ba24dc
authored
Fix segmentation fault caused by infinite recursion and unsafe array … (#213)
* Fix segmentation fault caused by infinite recursion and unsafe array 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.
* Removed accident build directory1 parent 3aa12f5 commit 2ba24dc
2 files changed
Lines changed: 11 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
142 | 143 | | |
143 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
144 | 148 | | |
145 | 149 | | |
146 | 150 | | |
| |||
167 | 171 | | |
168 | 172 | | |
169 | 173 | | |
| 174 | + | |
170 | 175 | | |
171 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
172 | 180 | | |
173 | 181 | | |
174 | 182 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
0 commit comments