goczmq icon indicating copy to clipboard operation
goczmq copied to clipboard

newChanneler: unsafe generation of inproc address

Open cyrilleverrier opened this issue 6 years ago • 0 comments

func newChanneler(sockType int, endpoints string, subscribe []string, options []SockOption) *Channeler {
...
	c := &Channeler{
		id:          rand.Int63(),
...
	}
	c.commandAddr = fmt.Sprintf("inproc://actorcontrol%d", c.id)
	c.proxyAddr = fmt.Sprintf("inproc://proxy%d", c.id)
...
}

If very unlucky, two different instances of Channeler may have the exact same internal inproc address. I would suggest to get a new c.id from an uuid string instead of rand.Int63() integer

cyrilleverrier avatar Feb 22 '19 13:02 cyrilleverrier