summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikael Magnusson <mikachu@gmail.com>2026-05-06 09:05:18 +0200
committerMikael Magnusson <mikachu@gmail.com>2026-05-11 21:30:56 +0200
commit642a97e455ae32f8ea34745f7419bf12b0adc56c (patch)
tree8afd3db369973556c6d4a66e7b7d31968f91137f
parent54479: Fix use-after-free when handling TRAPEXIT (diff)
downloadzsh-642a97e455ae32f8ea34745f7419bf12b0adc56c.tar
zsh-642a97e455ae32f8ea34745f7419bf12b0adc56c.tar.gz
zsh-642a97e455ae32f8ea34745f7419bf12b0adc56c.tar.bz2
zsh-642a97e455ae32f8ea34745f7419bf12b0adc56c.tar.lz
zsh-642a97e455ae32f8ea34745f7419bf12b0adc56c.tar.xz
zsh-642a97e455ae32f8ea34745f7419bf12b0adc56c.tar.zst
zsh-642a97e455ae32f8ea34745f7419bf12b0adc56c.zip
54480: Wrong memcmp variant used in getvirange()
Spotted this while looking for zlell assignments, I'm not sure exactly what the consequence was but presumably things sometimes went wrong.
-rw-r--r--ChangeLog3
-rw-r--r--Src/Zle/zle_vi.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 3b82bf9b6..c0b46a914 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,9 @@
* 54479: Src/exec.c: Fix use-after-free when handling TRAPEXIT
+ * 54480: Src/Zle/zle_vi.c: Wrong memcmp variant used in
+ getvirange()
+
2026-05-10 Oliver Kiddle <opk@zsh.org>
* unposted: Completion/Linux/Command/_selinux: complete files
diff --git a/Src/Zle/zle_vi.c b/Src/Zle/zle_vi.c
index 667063774..86543e172 100644
--- a/Src/Zle/zle_vi.c
+++ b/Src/Zle/zle_vi.c
@@ -233,7 +233,7 @@ getvirange(int wf)
/* It is an error to use a non-movement command to delimit the *
* range. We here reject the case where the command modified *
* the line, or selected a different history line. */
- if (histline != hist1 || zlell != lastll || memcmp(zleline, lastline, zlell)) {
+ if (histline != hist1 || zlell != lastll || ZS_memcmp(zleline, lastline, zlell)) {
histline = hist1;
ZS_memcpy(zleline, lastline, zlell = lastll);
zlecs = pos;