From b410026319f1fdf7305976a5f25dd8a35c55a451 Mon Sep 17 00:00:00 2001 From: Matthias Hanel Date: Thu, 18 Feb 2021 16:16:41 -0500 Subject: [PATCH] [fixed] out of range issue in processMsgResults during subject rewrite Signed-off-by: Matthias Hanel --- server/client.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/client.go b/server/client.go index 50b16dd1..990796d1 100644 --- a/server/client.go +++ b/server/client.go @@ -3887,7 +3887,7 @@ func (c *client) processMsgResults(acc *Account, r *SublistResult, msg, deliver, c.kind != CLIENT && c.kind != SYSTEM && c.kind != JETSTREAM && c.kind != ACCOUNT && bytes.HasPrefix(creply, []byte(jsAckPre)) { // We need to rewrite the subject and the reply. - if li := bytes.LastIndex(creply, []byte("@")); li != 0 && li < len(creply)-1 { + if li := bytes.LastIndex(creply, []byte("@")); li != -1 && li < len(creply)-1 { subj, creply = creply[li+1:], creply[:li] } }