mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2026-11-09 04:09:43 -10:00
Calling Close on an SSHClient that never connected, or whose Connect failed, dereferenced a nil *ssh.Client. goja turned the panic into a request error, so the template stopped at Close and returned nothing. Close also kept the closed client. On a client reused across login attempts, a later Close then failed with "use of closed network connection", and Run reported a transport error instead of "no connection". Close now returns true when no connection is open, and clears the connection after closing it. It returns true rather than an error because goja throws a returned error as a JS exception, which would still abort the template. Fixes: #8070 Signed-off-by: Dwi Siswanto <[email protected]>