PATCH 2/3: Don't read COLORVAR out of bounds

Mikael Magnusson <[email protected]>
Newsgroups gmane.comp.shells.zsh.devel
Message-ID <[email protected]>
This could happen if a terminal replies with a bg value we don't know
about.
---
 Src/Zle/termquery.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Src/Zle/termquery.c b/Src/Zle/termquery.c
index f5d5302297..9bbe226783 100644
--- a/Src/Zle/termquery.c
+++ b/Src/Zle/termquery.c
@@ -457,6 +457,8 @@ handle_color(int bg, int red, int green, int blue)
         case 2:  /* cursor color */
 	    memo_cursor = (red << 24) | (green << 16) | (blue << 8);
 	    break;
+	default: /* invalid color */
+	    return;
     }
 
     colour = zalloc(8);
-- 
2.38.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.