diff options
author | Barton E. Schaefer <schaefer@zsh.org> | 2017-01-29 08:30:14 -0800 |
---|---|---|
committer | Barton E. Schaefer <schaefer@zsh.org> | 2017-01-29 08:30:14 -0800 |
commit | e51c9c17af51e4055efb5a2cc36739d1d7ae457f (patch) | |
tree | b77de131860f9f0d48ed0604d095a82c59665a1a /Src/Zle/zle_hist.c | |
parent | 0672c753596bd454e7456fe660eab1b8bf2879d1 (diff) | |
download | zsh-e51c9c17af51e4055efb5a2cc36739d1d7ae457f.tar.gz zsh-e51c9c17af51e4055efb5a2cc36739d1d7ae457f.tar.xz zsh-e51c9c17af51e4055efb5a2cc36739d1d7ae457f.zip |
40453: signal handler safety for callers of patcompile(PAT_STATIC), which is not re-entrant.
Diffstat (limited to 'Src/Zle/zle_hist.c')
-rw-r--r-- | Src/Zle/zle_hist.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Src/Zle/zle_hist.c b/Src/Zle/zle_hist.c index 434735de9..581ca4979 100644 --- a/Src/Zle/zle_hist.c +++ b/Src/Zle/zle_hist.c @@ -1220,10 +1220,12 @@ doisearch(char **args, int dir, int pattern) char *patbuf = ztrdup(sbuf); char *patstring; /* - * 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. + * Do not use static pattern buffer (PAT_STATIC) since we + * call zle hooks, which might call other pattern + * functions. Use PAT_ZDUP because we re-use the pattern + * in subsequent loops, so we can't pushheap/popheap. + * Use PAT_NOANCH because we don't need the match anchored + * to the end, even if it is at the start. */ int patflags = PAT_ZDUP|PAT_NOANCH; if (sbuf[0] == '^') { |