From f64e466472d3ab89be1de239c8f885fa955c8a4a Mon Sep 17 00:00:00 2001 From: David Dworken Date: Mon, 18 Nov 2024 15:25:03 -0800 Subject: [PATCH] Fix error when searching for just a literal colon --- client/lib/lib.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/lib/lib.go b/client/lib/lib.go index ec984f4..9450f0a 100644 --- a/client/lib/lib.go +++ b/client/lib/lib.go @@ -852,6 +852,9 @@ func parseNonAtomizedToken(token string) (string, any, any, any, error) { func parseAtomizedToken(ctx context.Context, token string) (string, any, any, error) { splitToken := splitEscaped(token, ':', 2) + if len(splitToken) != 2 { + return "", nil, nil, fmt.Errorf("search query contains malformed search atom '%s'", token) + } field := unescape(splitToken[0]) val := unescape(splitToken[1]) switch field {