$NetBSD: patch-CVE-2014-8964,v 1.1 2014/11/30 14:48:43 spz Exp $

patch for CVE-2014-8964 taken from
http://bugs.exim.org/show_bug.cgi?id=1546

--- pcre_exec.c.orig	2014-09-15 13:48:59.000000000 +0000
+++ pcre_exec.c
@@ -1404,8 +1404,11 @@ for (;;)
         condition = TRUE;
 
         /* Advance ecode past the assertion to the start of the first branch,
-        but adjust it so that the general choosing code below works. */
+        but adjust it so that the general choosing code below works. If the
+        assertion has a quantifier that allows zero repeats we must skip over
+        the BRAZERO. This is a lunatic thing to do, but somebody did! */
 
+        if (*ecode == OP_BRAZERO) ecode++;
         ecode += GET(ecode, 1);
         while (*ecode == OP_ALT) ecode += GET(ecode, 1);
         ecode += 1 + LINK_SIZE - PRIV(OP_lengths)[condcode];
