chiark / gitweb /
64786a0c8239c0edefeb0692b00b6509836cba36
[pcre3.git] / debian / patches / cve-2014-8964.patch
1 Description: CVE-2014-8964, heap buffer overflow
2  Heap buffer overflow if an assertion with a zero minimum repeat is used as
3  the condition in a conditional group.
4 Origin: upstream http://bugs.exim.org/show_bug.cgi?id=1546
5 Bug: http://bugs.exim.org/show_bug.cgi?id=1546
6 Applied-Upstream: Yes, after 8.36
7 ---
8 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
9 --- a/pcre_exec.c
10 +++ b/pcre_exec.c
11 @@ -1404,8 +1404,11 @@
12          condition = TRUE;
13  
14          /* Advance ecode past the assertion to the start of the first branch,
15 -        but adjust it so that the general choosing code below works. */
16 +        but adjust it so that the general choosing code below works. If the
17 +       assertion has a quantifier that allows zero repeats we must skip over
18 +       the BRAZERO. This is a lunatic thing to do, but somebody did! */
19  
20 +       if (*ecode == OP_BRAZERO) ecode++;
21          ecode += GET(ecode, 1);
22          while (*ecode == OP_ALT) ecode += GET(ecode, 1);
23          ecode += 1 + LINK_SIZE - PRIV(OP_lengths)[condcode];