public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/zsh] f44: fix crash with bracketed-paste-magic and undo
@ 2026-07-22 15:58 
  0 siblings, 0 replies; only message in thread
From:  @ 2026-07-22 15:58 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/zsh
            Branch : f44
            Commit : 202c9ba0230841b1b879650bff731b7141403a25
            Author : Lukáš Zaoral <lzaoral@redhat.com>
            Date   : 2026-07-22T17:51:15+02:00
            Stats  : +90/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/zsh/c/202c9ba0230841b1b879650bff731b7141403a25?branch=f44

            Log:
            fix crash with bracketed-paste-magic and undo

Resolves: rhbz#2484692

---
diff --git a/0011-zsh-memcpy-sigsegv-bracketed-paste.patch b/0011-zsh-memcpy-sigsegv-bracketed-paste.patch
new file mode 100644
index 0000000..5310b19
--- /dev/null
+++ b/0011-zsh-memcpy-sigsegv-bracketed-paste.patch
@@ -0,0 +1,83 @@
+From b258cb7816323050d7e485171c92ad3f1046799e Mon Sep 17 00:00:00 2001
+From: Mikael Magnusson <mikachu@gmail.com>
+Date: Fri, 17 Jul 2026 22:53:21 +0200
+Subject: [PATCH] 54985: fix crash with bracketed-paste-magic and undo
+
+In particular, fc -P/-p didn't interact well with undo. Make sure we
+store/restore histline across those calls.
+
+(cherry-picked from commit 7708d466dfab8dd29f9ae5de12c74af37bf99a4d)
+---
+ Src/Zle/zle_main.c | 8 ++++++++
+ Src/hist.c         | 7 ++++++-
+ Src/zsh.h          | 3 ++-
+ 3 files changed, 16 insertions(+), 2 deletions(-)
+
+diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c
+index 44ee63d..817e605 100644
+--- a/Src/Zle/zle_main.c
++++ b/Src/Zle/zle_main.c
+@@ -2168,6 +2168,14 @@ zle_main_entry(int cmd, va_list ap)
+ 	break;
+     }
+ 
++    case ZLE_CMD_GET_HIST_LINE:
++    {
++	zlong *p = va_arg(ap, zlong *);
++	*p = histline;
++
++	break;
++    }
++
+     default:
+ #ifdef DEBUG
+ 	    dputs("Bad command %d in zle_main_entry", cmd);
+diff --git a/Src/hist.c b/Src/hist.c
+index f58db23..85f329c 100644
+--- a/Src/hist.c
++++ b/Src/hist.c
+@@ -226,6 +226,7 @@ static struct histsave {
+     HashTable histtab;
+     Histent hist_ring;
+     zlong curhist;
++    zlong histline;
+     zlong histlinect;
+     zlong histsiz;
+     zlong savehistsiz;
+@@ -3846,6 +3847,10 @@ pushhiststack(char *hf, zlong hs, zlong shs, int level)
+     h->histsiz = histsiz;
+     h->savehistsiz = savehistsiz;
+     h->locallevel = level;
++    if (zleactive)
++	zleentry(ZLE_CMD_GET_HIST_LINE, &h->histline);
++    else
++	h->histline = 0;
+ 
+     memset(&lasthist, 0, sizeof lasthist);
+     if (hf) {
+@@ -3898,7 +3903,7 @@ pophiststack(void)
+     hist_ring = h->hist_ring;
+     curhist = h->curhist;
+     if (zleactive)
+-	zleentry(ZLE_CMD_SET_HIST_LINE, curhist);
++	zleentry(ZLE_CMD_SET_HIST_LINE, h->histline);
+     histlinect = h->histlinect;
+     histsiz = h->histsiz;
+     savehistsiz = h->savehistsiz;
+diff --git a/Src/zsh.h b/Src/zsh.h
+index 8fab0eb..32302ec 100644
+--- a/Src/zsh.h
++++ b/Src/zsh.h
+@@ -3244,7 +3244,8 @@ enum {
+     ZLE_CMD_REFRESH,
+     ZLE_CMD_SET_KEYMAP,
+     ZLE_CMD_GET_KEY,
+-    ZLE_CMD_SET_HIST_LINE
++    ZLE_CMD_SET_HIST_LINE,
++    ZLE_CMD_GET_HIST_LINE,
+ };
+ 
+ /***************************************/
+-- 
+2.55.0
+

diff --git a/zsh.spec b/zsh.spec
index 3598f05..55174ac 100644
--- a/zsh.spec
+++ b/zsh.spec
@@ -1,7 +1,7 @@
 Summary: Powerful interactive shell
 Name: zsh
 Version: 5.9
-Release: 20%{?dist}
+Release: 21%{?dist}
 License: MIT-Modern-Variant AND ISC AND GPL-2.0-only
 URL: http://zsh.sourceforge.net/
 Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz
@@ -33,6 +33,9 @@ Patch8: 0008-zsh-deletefilelist-segfault.patch
 Patch9: 0009-zsh-support-dnf5.patch
 # upstream commit 071e325c826a89b792056c3faf0c400b8c0c5738
 Patch10: 0010-zsh-fix-dnf5-completion-with-rpm-files.patch
+# upstream commit 7708d466dfab8dd29f9ae5de12c74af37bf99a4d
+# fix crash with bracketed-paste-magic and undo (rhbz#2484692)
+Patch11: 0011-zsh-memcpy-sigsegv-bracketed-paste.patch
 
 # downstream patch for rhbz#2449939
 # already fixed upstream in a major refactor of term color attribute handling
@@ -182,6 +185,9 @@ fi
 %doc Doc/*.html
 
 %changelog
+* Wed Jul 22 2026 Lukáš Zaoral <lzaoral@redhat.com> - 5.9-21
+- fix crash with bracketed-paste-magic and undo (rhbz#2484692)
+
 * Tue Mar 24 2026 Lukáš Zaoral <lzaoral@redhat.com> - 5.9-20
 - fix segfault in _IO_putc (rhbz#2449939)
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-07-22 15:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-22 15:58 [rpms/zsh] f44: fix crash with bracketed-paste-magic and undo 

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox