summaryrefslogtreecommitdiff
path: root/debian/patches
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2017-01-17 01:21:33 +0100
committerAxel Beckert <abe@deuxchevaux.org>2017-01-17 01:21:33 +0100
commit348c47bdc3b6a92558d82086d168e7829437388a (patch)
treeda238883f80ee466e5ae98bc6f2a7059ac7693ac /debian/patches
parentc3097b98978a494dbf7e5b1dc931ed1f2754f8cb (diff)
downloadzsh-348c47bdc3b6a92558d82086d168e7829437388a.tar.gz
zsh-348c47bdc3b6a92558d82086d168e7829437388a.zip
Cherry-pick four stability patches from upstream
Diffstat (limited to 'debian/patches')
-rw-r--r--debian/patches/cherry-pick_2e76fb80_turn_off_POSIX_IDENTIFIERS_option_in_completion.patch15
-rw-r--r--debian/patches/cherry-pick_48cadf48_be_more_careful_with_pattern_allocation_in_history_isearch.patch59
-rw-r--r--debian/patches/cherry-pick_8d4c9854_zero_new_space_allocated_in_prompt_buffer.patch15
-rw-r--r--debian/patches/cherry-pick_ebd7fdd9_fix_setting_of_parameter_values_in_compvalues.patch18
-rw-r--r--debian/patches/series4
5 files changed, 111 insertions, 0 deletions
diff --git a/debian/patches/cherry-pick_2e76fb80_turn_off_POSIX_IDENTIFIERS_option_in_completion.patch b/debian/patches/cherry-pick_2e76fb80_turn_off_POSIX_IDENTIFIERS_option_in_completion.patch
new file mode 100644
index 000000000..87a28a13e
--- /dev/null
+++ b/debian/patches/cherry-pick_2e76fb80_turn_off_POSIX_IDENTIFIERS_option_in_completion.patch
@@ -0,0 +1,15 @@
+Description: turn off POSIX_IDENTIFIERS option in completion
+Origin: 2e76fb80b4c228944b57b8f669e75456a23f147d
+Author: Peter Stephenson <pws@zsh.org>
+Reviewed-By: Axel Beckert <abe@debian.org>
+
+--- a/Completion/compinit
++++ b/Completion/compinit
+@@ -153,6 +153,7 @@
+ NO_markdirs
+ NO_octalzeroes
+ NO_posixbuiltins
++ NO_posixidentifiers
+ NO_shwordsplit
+ NO_shglob
+ NO_warncreateglobal
diff --git a/debian/patches/cherry-pick_48cadf48_be_more_careful_with_pattern_allocation_in_history_isearch.patch b/debian/patches/cherry-pick_48cadf48_be_more_careful_with_pattern_allocation_in_history_isearch.patch
new file mode 100644
index 000000000..f15f702f7
--- /dev/null
+++ b/debian/patches/cherry-pick_48cadf48_be_more_careful_with_pattern_allocation_in_history_isearch.patch
@@ -0,0 +1,59 @@
+Description: Be more careful with pattern allocation in history isearch.
+ If there are ZLE hooks to be called, they may use patterns, in
+ which case it's not safe to allocate the isearch pattern in the
+ static buffer.
+Origin: 48cadf48ff9c61ce09e826ad9a58e250e999a262
+Author: Peter Stephenson <pws@zsh.org>
+Reviewed-By: Daniel Shahaf <d.s@daniel.shahaf.name>
+
+--- a/Src/Zle/zle_hist.c
++++ b/Src/Zle/zle_hist.c
+@@ -1220,13 +1220,12 @@
+ char *patbuf = ztrdup(sbuf);
+ char *patstring;
+ /*
+- * Use static pattern buffer since we don't need
+- * to maintain it and won't call other pattern functions
+- * meanwhile.
++ * Do not use static pattern buffer (PAT_STATIC) since we call zle hooks,
++ * which might call other pattern functions. Use PAT_ZDUP instead.
+ * Use PAT_NOANCH because we don't need the match
+ * anchored to the end, even if it is at the start.
+ */
+- int patflags = PAT_STATIC|PAT_NOANCH;
++ int patflags = PAT_ZDUP|PAT_NOANCH;
+ if (sbuf[0] == '^') {
+ /*
+ * We'll handle the anchor later when
+@@ -1521,6 +1520,7 @@
+ if (only_one || !top_spot || old_sbptr != sbptr)
+ break;
+ }
++ freepatprog(patprog);
+ patprog = NULL;
+ nosearch = 1;
+ skip_pos = 0;
+@@ -1632,6 +1632,7 @@
+ }
+ strcpy(sbuf + sbptr, paste);
+ sbptr += pastelen;
++ freepatprog(patprog);
+ patprog = NULL;
+ free(paste);
+ } else if (cmd == Th(z_acceptsearch)) {
+@@ -1682,6 +1683,7 @@
+ * always valid at this point.
+ */
+ sbptr += zlecharasstring(LASTFULLCHAR, sbuf + sbptr);
++ freepatprog(patprog);
+ patprog = NULL;
+ }
+ if (feep)
+@@ -1702,6 +1704,7 @@
+ zsfree(okeymap);
+ if (matchlist)
+ freematchlist(matchlist);
++ freepatprog(patprog);
+ isearch_active = 0;
+ /*
+ * Don't allow unused characters provided as a string to the
diff --git a/debian/patches/cherry-pick_8d4c9854_zero_new_space_allocated_in_prompt_buffer.patch b/debian/patches/cherry-pick_8d4c9854_zero_new_space_allocated_in_prompt_buffer.patch
new file mode 100644
index 000000000..acfcc2bec
--- /dev/null
+++ b/debian/patches/cherry-pick_8d4c9854_zero_new_space_allocated_in_prompt_buffer.patch
@@ -0,0 +1,15 @@
+Description: zero new space allocated in prompt buffer
+Origin: 8d4c98540de9bcdba8565facc91fbc45855d27e2
+Author: Paulo Andrade <pandrade@redhat.com>
+Reviewed-By: Daniel Shahaf <d.s@daniel.shahaf.name>
+
+--- a/Src/prompt.c
++++ b/Src/prompt.c
+@@ -920,6 +920,7 @@
+ if(need & 255)
+ need = (need | 255) + 1;
+ bv->buf = realloc(bv->buf, bv->bufspc += need);
++ memset(bv->buf + bv->bufspc - need, 0, need);
+ bv->bp = bv->buf + bo;
+ if(bo1 != -1)
+ bv->bp1 = bv->buf + bo1;
diff --git a/debian/patches/cherry-pick_ebd7fdd9_fix_setting_of_parameter_values_in_compvalues.patch b/debian/patches/cherry-pick_ebd7fdd9_fix_setting_of_parameter_values_in_compvalues.patch
new file mode 100644
index 000000000..3ab071006
--- /dev/null
+++ b/debian/patches/cherry-pick_ebd7fdd9_fix_setting_of_parameter_values_in_compvalues.patch
@@ -0,0 +1,18 @@
+Description: Fix setting of parameter values in compvalues
+Origin: ebd7fdd9326cf36feda3b0ca906d7b9b8bf79cb5
+Author: Peter Stephenson <p.w.stephenson@ntlworld.com>
+Reviewed-By: Daniel Shahaf <d.s@daniel.shahaf.name>
+
+--- a/Src/Zle/computil.c
++++ b/Src/Zle/computil.c
+@@ -3546,8 +3546,8 @@
+ Cvval val = cv_get_val(cv_laststate.d, args[1]);
+
+ if (val && val->arg) {
+- setsparam(args[2], val->arg->descr);
+- setsparam(args[3], val->arg->action);
++ setsparam(args[2], ztrdup(val->arg->descr));
++ setsparam(args[3], ztrdup(val->arg->action));
+
+ if (args[4])
+ setsparam(args[4], ztrdup(val->name));
diff --git a/debian/patches/series b/debian/patches/series
index 90d273eaa..21838bb34 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,7 @@ update-debian-sections.patch
remove-SH_USE_BSD_ECHO-autoconf-test-to-make-build-more-reproducible.patch
update_bts_completion.patch
swaks_completion.patch
+cherry-pick_8d4c9854_zero_new_space_allocated_in_prompt_buffer.patch
+cherry-pick_48cadf48_be_more_careful_with_pattern_allocation_in_history_isearch.patch
+cherry-pick_ebd7fdd9_fix_setting_of_parameter_values_in_compvalues.patch
+cherry-pick_2e76fb80_turn_off_POSIX_IDENTIFIERS_option_in_completion.patch