Commit 39dc654
authored
fix(ssh): remove unreachable code in connectOrDie, wrap last error (#655)
After the retry loop, connectionFailed is always true, making the
final return statement unreachable. Simplify to unconditionally return
the error after the loop. Also wrap the last dial error with %w so
callers see the root cause (e.g. 'connection refused').
Audit findings #5 (HIGH), #6 (HIGH), #27 (LOW).
Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>1 parent 6e63f12 commit 39dc654
2 files changed
+7
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
155 | | - | |
| 154 | + | |
| 155 | + | |
156 | 156 | | |
157 | | - | |
158 | | - | |
159 | | - | |
| 157 | + | |
160 | 158 | | |
161 | 159 | | |
162 | 160 | | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
167 | | - | |
| 161 | + | |
168 | 162 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
464 | 464 | | |
465 | 465 | | |
466 | 466 | | |
467 | | - | |
468 | 467 | | |
469 | 468 | | |
470 | 469 | | |
471 | | - | |
| 470 | + | |
472 | 471 | | |
473 | | - | |
474 | | - | |
475 | 472 | | |
476 | 473 | | |
477 | 474 | | |
478 | | - | |
479 | | - | |
480 | | - | |
481 | | - | |
482 | | - | |
| 475 | + | |
483 | 476 | | |
0 commit comments