From 0fb9691705e33e9825d573bf94bcc4fc72113639 Mon Sep 17 00:00:00 2001 From: Guillaume Ballet Date: Tue, 27 Mar 2018 16:04:03 +0200 Subject: [PATCH] whisper: Allocate the full topic length in the copy This is so that the partial topic code (currently disabled) does not crash when trying to access byte #3, --- whisper/whisperv6/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/whisper/whisperv6/api.go b/whisper/whisperv6/api.go index f75e502473..3f3a082afe 100644 --- a/whisper/whisperv6/api.go +++ b/whisper/whisperv6/api.go @@ -560,7 +560,7 @@ func (api *PublicWhisperAPI) NewMessageFilter(req Criteria) (string, error) { if len(req.Topics) > 0 { topics = make([][]byte, len(req.Topics)) for i, topic := range req.Topics { - topics[i] = make([]byte, len(topic)) + topics[i] = make([]byte, TopicLength) copy(topics[i], topic[:]) } }