Commit b031b5cf authored by Russ Cox's avatar Russ Cox

net: fix crash in DialIP

Reported by jan.newmarch.

Fixes #1130.

R=r
CC=golang-dev
https://golang.org/cl/2212043
parent daf64bf5
......@@ -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]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment