summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorBarton E. Schaefer <schaefer@zsh.org>2016-04-23 14:20:16 -0700
committerBarton E. Schaefer <schaefer@zsh.org>2016-04-23 14:20:16 -0700
commit222dea055c622822ff24a2fa14564231bf3323d0 (patch)
treecbf00fab95aaa766805ea39be6742f7d4bbc8646 /Src
parente1c745a0dca56afb9cfcace1ef59449152290188 (diff)
downloadzsh-222dea055c622822ff24a2fa14564231bf3323d0.tar.gz
zsh-222dea055c622822ff24a2fa14564231bf3323d0.tar.xz
zsh-222dea055c622822ff24a2fa14564231bf3323d0.zip
Mikael Berthe: 38307: PCRE segfault when parenthesized group matches nothing
unposted: regression test for 38307
Diffstat (limited to 'Src')
-rw-r--r--Src/Modules/pcre.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Src/Modules/pcre.c b/Src/Modules/pcre.c
index e23ab57f5..5fd67963d 100644
--- a/Src/Modules/pcre.c
+++ b/Src/Modules/pcre.c
@@ -228,7 +228,7 @@ zpcre_get_substrings(char *arg, int *ovec, int ret, char *matchvar,
 		    /* Find the start offset */
 		    MB_CHARINIT();
 		    leftlen = ipair[0];
-		    while (leftlen) {
+		    while (leftlen > 0) {
 			offs++;
 			clen = MB_CHARLEN(ptr, leftlen);
 			ptr += clen;