diff --git a/zsh-5.0.7-heredocs-sigsegv.patch b/zsh-5.0.7-heredocs-sigsegv.patch
new file mode 100644
index 0000000..46a0d80
--- /dev/null
+++ b/zsh-5.0.7-heredocs-sigsegv.patch
@@ -0,0 +1,28 @@
+From 9b948be0afaa3ab0dee1e04edd2b577cf4010290 Mon Sep 17 00:00:00 2001
+From: Peter Stephenson
+Date: Fri, 17 Apr 2015 22:43:38 +0100
+Subject: [PATCH] 34921: handle error in recursive par_event().
+
+Here documents in an interrupted list caused bad juju.
+
+Upstream-commit: 2e48eceb1ad2b7b33170d7104e94351cc7231e51
+Signed-off-by: Kamil Dudka
+---
+ Src/parse.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/Src/parse.c b/Src/parse.c
+index 433efb9..30270ef 100644
+--- a/Src/parse.c
++++ b/Src/parse.c
+@@ -515,6 +515,7 @@ par_event(void)
+ if (!par_event()) {
+ ecused = oec;
+ ecbuf[p] |= wc_bdata(Z_END);
++ return errflag ? 0 : 1;
+ }
+ }
+ return 1;
+--
+2.1.0
+
diff --git a/zsh.spec b/zsh.spec
index 88d3fd1..b3e4e87 100644
--- a/zsh.spec
+++ b/zsh.spec
@@ -3,7 +3,7 @@
Summary: Powerful interactive shell
Name: zsh
Version: 5.0.7
-Release: 6%{?dist}
+Release: 7%{?dist}
License: MIT
URL: http://zsh.sourceforge.net/
Group: System Environment/Shells
@@ -29,6 +29,9 @@ Patch7: zsh-5.0.7-close-fd.patch
# improve handling of NULL in the 'cd' built-in (#1183238)
Patch8: zsh-5.0.7-cd-sigsegv.patch
+# fix SIGSEGV when handling heredocs and keyboard interrupt (#972624)
+Patch9: zsh-5.0.7-heredocs-sigsegv.patch
+
BuildRequires: coreutils sed ncurses-devel libcap-devel
BuildRequires: texinfo texi2html gawk hostname
Requires(post): info grep
@@ -68,6 +71,7 @@ This package contains the Zsh manual in html format.
%patch6 -p1
%patch7 -p1
%patch8 -p1
+%patch9 -p1
cp -p %SOURCE7 .
@@ -185,6 +189,9 @@ fi
%doc Doc/*.html
%changelog
+* Mon Apr 20 2015 Kamil Dudka - 5.0.7-7
+- fix SIGSEGV when handling heredocs and keyboard interrupt (#972624)
+
* Sun Jan 25 2015 Kamil Dudka - 5.0.7-6
- use correct allocation function in the new 'cd' code (#1183238)