Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

fix: patch config-ssh panic condition #210

Merged
merged 1 commit into from
Jan 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions internal/cmd/configssh.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,10 @@ func removeOldConfig(config string) (string, bool) {
if startIndex == -1 || endIndex == -1 {
return config, false
}
config = config[:startIndex-1] + config[endIndex+len(sshEndToken)+1:]

return config, true
if startIndex == 0 {
return config[endIndex+len(sshEndToken)+1:], true
}
return config[:startIndex-1] + config[endIndex+len(sshEndToken)+1:], true
}

// sshAvailable returns true if SSH is available for at least one environment.
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy