mirror of
https://github.com/golang/go
synced 2024-11-22 03:14:41 -07:00
net: fix crash in DialIP
Reported by jan.newmarch. Fixes #1130. R=r CC=golang-dev https://golang.org/cl/2212043
This commit is contained in:
parent
daf64bf567
commit
b031b5cfde
@ -288,7 +288,7 @@ func readProtocols() {
|
||||
func netProtoSplit(netProto string) (net string, proto int, err os.Error) {
|
||||
onceReadProtocols.Do(readProtocols)
|
||||
i := last(netProto, ':')
|
||||
if i+1 >= len(netProto) { // no colon
|
||||
if i < 0 { // no colon
|
||||
return "", 0, os.ErrorString("no IP protocol specified")
|
||||
}
|
||||
net = netProto[0:i]
|
||||
|
Loading…
Reference in New Issue
Block a user