From 466bf4a3c4a3c3f7336ee0550b0bebefba6f5b96 Mon Sep 17 00:00:00 2001 From: Sebastian Sturm Date: Mon, 31 Aug 2020 22:39:42 +0200 Subject: [PATCH] Fix out-of-bounds access (#19) --- lsp-ivy.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lsp-ivy.el b/lsp-ivy.el index 5cc2ef0..c4841f7 100644 --- a/lsp-ivy.el +++ b/lsp-ivy.el @@ -137,7 +137,8 @@ ((&SymbolInformation :name :kind :container-name? :location (&Location :uri)) project-root) "Convert the match returned by `lsp-mode` into a candidate string." - (let* ((type (elt lsp-ivy-symbol-kind-to-face kind)) + (let* ((sanitized-kind (if (< kind (length lsp-ivy-symbol-kind-to-face)) kind 0)) + (type (elt lsp-ivy-symbol-kind-to-face sanitized-kind)) (typestr (if lsp-ivy-show-symbol-kind (propertize (format "[%s] " (car type)) 'face (cdr type)) ""))