From e51c9c17af51e4055efb5a2cc36739d1d7ae457f Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Sun, 29 Jan 2017 08:30:14 -0800 Subject: 40453: signal handler safety for callers of patcompile(PAT_STATIC), which is not re-entrant. --- Src/Zle/zle_hist.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Src/Zle/zle_hist.c') 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] == '^') { -- cgit 1.4.1