summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2026-05-07 01:44:32 +0200
committerOliver Kiddle <opk@zsh.org>2026-05-10 21:58:44 +0200
commit29a82bbe007a1cdcd7d4ec6e5175f3bc7fe9b63d (patch)
tree29457dfca213d50ba6416e70abef02054236e36b
parent54445: support more systems in terminal name completion (diff)
downloadzsh-29a82bbe007a1cdcd7d4ec6e5175f3bc7fe9b63d.tar
zsh-29a82bbe007a1cdcd7d4ec6e5175f3bc7fe9b63d.tar.gz
zsh-29a82bbe007a1cdcd7d4ec6e5175f3bc7fe9b63d.tar.bz2
zsh-29a82bbe007a1cdcd7d4ec6e5175f3bc7fe9b63d.tar.lz
zsh-29a82bbe007a1cdcd7d4ec6e5175f3bc7fe9b63d.tar.xz
zsh-29a82bbe007a1cdcd7d4ec6e5175f3bc7fe9b63d.tar.zst
zsh-29a82bbe007a1cdcd7d4ec6e5175f3bc7fe9b63d.zip
54486: fix reading outside string issue reported by valgrind
-rw-r--r--ChangeLog3
-rw-r--r--Doc/Zsh/zle.yo2
-rw-r--r--Src/Zle/termquery.c8
3 files changed, 8 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 3b22b18a3..4a355bd2b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2026-05-10 Oliver Kiddle <opk@zsh.org>
+ * 54486: Doc/Zsh/zle.yo, Src/Zle/termquery.c: fix reading
+ outside string issue reported by valgrind
+
* 54445: Completion/Unix/Type/_terminals: parse termcap
and full terminfo source formats to support more systems
diff --git a/Doc/Zsh/zle.yo b/Doc/Zsh/zle.yo
index 8c1cd078d..f1f283d8d 100644
--- a/Doc/Zsh/zle.yo
+++ b/Doc/Zsh/zle.yo
@@ -2636,7 +2636,7 @@ as by adding `tt(-cursor)' to disable cursor shape and color changing.
When ZLE starts, it will add entries for features that were auto-detected. This
auto-detection uses extensions itself, all named with a `tt(query)' prefix. As
-this happens when ZLE starts disabling them needs to be done early in the
+this happens when ZLE starts, disabling them needs to be done early in the
startup files. A value of `tt(-query)' will disable all terminal queries on
startup, including those that query terminal properties such as colors rather
than detecting features. Populating the array with the status of auto-detected
diff --git a/Src/Zle/termquery.c b/Src/Zle/termquery.c
index bd601735f..aefc495f3 100644
--- a/Src/Zle/termquery.c
+++ b/Src/Zle/termquery.c
@@ -707,11 +707,11 @@ collate_seq(int sindex, int dir)
int negate = (**e == '-');
if (negate != enabled)
continue;
- if ((editext[i].class &&
- !strncmp(*e + negate, editext[i].key, editext[i].class) &&
- !*(*e + negate + editext[i].class)) ||
+ if ((!editext[i].class ||
+ !strncmp(*e + negate, editext[i].key, editext[i].class)) &&
+ ((editext[i].class && !*(*e + negate + editext[i].class)) ||
!strcmp(*e + negate + editext[i].class,
- editext[i].key + editext[i].class))
+ editext[i].key + editext[i].class)))
{
enabled = !negate;
break;