Merge pull request #264 from AkihiroSuda/fix-listener-panic
buildkitd: fix index-out-of-range panic in parsing wrong addr stringdocker-18.09
commit
821ea435d3
|
@ -214,6 +214,10 @@ func serveGRPC(server *grpc.Server, addrs []string, errCh chan error) error {
|
||||||
|
|
||||||
func getListener(addr string) (net.Listener, error) {
|
func getListener(addr string) (net.Listener, error) {
|
||||||
addrSlice := strings.SplitN(addr, "://", 2)
|
addrSlice := strings.SplitN(addr, "://", 2)
|
||||||
|
if len(addrSlice) < 2 {
|
||||||
|
return nil, errors.Errorf("address %s does not contain proto, you meant unix://%s ?",
|
||||||
|
addr, addr)
|
||||||
|
}
|
||||||
proto := addrSlice[0]
|
proto := addrSlice[0]
|
||||||
listenAddr := addrSlice[1]
|
listenAddr := addrSlice[1]
|
||||||
switch proto {
|
switch proto {
|
||||||
|
|
Loading…
Reference in New Issue