From 9ab46073e99a111b640584634d396a0538946d41 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Sat, 21 Oct 2017 15:29:35 -0600 Subject: [PATCH] disallow connections without the proper messaging --- relay.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/relay.go b/relay.go index 12921e3b..6dad46d7 100644 --- a/relay.go +++ b/relay.go @@ -117,6 +117,10 @@ func (r *Relay) clientCommuncation(id int, connection net.Conn) { sendMessage("who?", connection) m := strings.Split(receiveMessage(connection), ".") + if len(m) != 3 { + sendMessage("not enough information", connection) + return + } connectionType, codePhrase, metaData := m[0], m[1], m[2] key := codePhrase + "-" + strconv.Itoa(id) logger := log.WithFields(log.Fields{