diff options
author | adrianp <adrianp@pkgsrc.org> | 2005-11-01 21:49:31 +0000 |
---|---|---|
committer | adrianp <adrianp@pkgsrc.org> | 2005-11-01 21:49:31 +0000 |
commit | 33162c3bc2b12a781755d7bcadd1f34b9c23d8c6 (patch) | |
tree | 49384605bb627acd2134e246d85e03c1a811de1b /lang/python21/patches | |
parent | cd102c62dcb35e61f4dbba66e6dcd65200567784 (diff) | |
download | pkgsrc-33162c3bc2b12a781755d7bcadd1f34b9c23d8c6.tar.gz |
Bump to nb8 for PCRE security issue
Diffstat (limited to 'lang/python21/patches')
-rw-r--r-- | lang/python21/patches/patch-bd | 12 | ||||
-rw-r--r-- | lang/python21/patches/patch-be | 19 | ||||
-rw-r--r-- | lang/python21/patches/patch-bf | 73 |
3 files changed, 104 insertions, 0 deletions
diff --git a/lang/python21/patches/patch-bd b/lang/python21/patches/patch-bd new file mode 100644 index 00000000000..f4fac185292 --- /dev/null +++ b/lang/python21/patches/patch-bd @@ -0,0 +1,12 @@ +$NetBSD: patch-bd,v 1.1 2005/11/01 21:49:31 adrianp Exp $ + +--- Modules/pcre.h.orig 2000-06-28 21:56:30.000000000 +0100 ++++ Modules/pcre.h +@@ -40,6 +40,7 @@ extern "C" { + #ifdef FOR_PYTHON + #define PCRE_LOCALE 0x0200 + #endif ++#define PCRE_NO_AUTO_CAPTURE 0x1000 + + /* Exec-time error codes */ + diff --git a/lang/python21/patches/patch-be b/lang/python21/patches/patch-be new file mode 100644 index 00000000000..2062fb5ea06 --- /dev/null +++ b/lang/python21/patches/patch-be @@ -0,0 +1,19 @@ +$NetBSD: patch-be,v 1.1 2005/11/01 21:49:31 adrianp Exp $ + +--- Modules/pcre-int.h.orig 1998-05-07 16:32:38.000000000 +0100 ++++ Modules/pcre-int.h +@@ -81,11 +81,12 @@ only some permitted at run or study time + #define PUBLIC_OPTIONS \ + (PCRE_CASELESS|PCRE_EXTENDED|PCRE_ANCHORED|PCRE_MULTILINE| \ + PCRE_DOTALL|PCRE_DOLLAR_ENDONLY|PCRE_EXTRA|PCRE_UNGREEDY| \ +- PCRE_LOCALE) ++ PCRE_NO_AUTO_CAPTURE|PCRE_LOCALE) + #else + #define PUBLIC_OPTIONS \ + (PCRE_CASELESS|PCRE_EXTENDED|PCRE_ANCHORED|PCRE_MULTILINE| \ +- PCRE_DOTALL|PCRE_DOLLAR_ENDONLY|PCRE_EXTRA|PCRE_UNGREEDY) ++ PCRE_DOTALL|PCRE_DOLLAR_ENDONLY|PCRE_EXTRA|PCRE_UNGREEDY| \ ++ PCRE_NO_AUTO_CAPTURE) + #endif + #define PUBLIC_EXEC_OPTIONS \ + (PCRE_CASELESS|PCRE_ANCHORED|PCRE_MULTILINE|PCRE_NOTBOL|PCRE_NOTEOL| \ diff --git a/lang/python21/patches/patch-bf b/lang/python21/patches/patch-bf new file mode 100644 index 00000000000..bfc7f1ab269 --- /dev/null +++ b/lang/python21/patches/patch-bf @@ -0,0 +1,73 @@ +$NetBSD: patch-bf,v 1.1 2005/11/01 21:49:31 adrianp Exp $ + +--- Modules/pypcre.c.orig 2000-08-02 14:41:18.000000000 +0100 ++++ Modules/pypcre.c +@@ -1162,14 +1162,31 @@ read_repeat_counts(const uschar *p, int + int min = 0; + int max = -1; + ++/* Read the minimum value and do a paranoid check: a negative value indicates ++an integer overflow. */ ++ + while ((pcre_ctypes[*p] & ctype_digit) != 0) min = min * 10 + *p++ - '0'; + ++if (min < 0 || min > 65535) ++ { ++ *errorptr = ERR5; ++ return p; ++ } ++ ++/* Read the maximum value if there is one, and again do a paranoid on its size ++. Also, max must not be less than min. */ ++ + if (*p == '}') max = min; else + { + if (*(++p) != '}') + { + max = 0; + while((pcre_ctypes[*p] & ctype_digit) != 0) max = max * 10 + *p++ - '0'; ++ if (max < 0 || max > 65535) ++ { ++ *errorptr = ERR5; ++ return p; ++ } + if (max < min) + { + *errorptr = ERR4; +@@ -2266,6 +2283,7 @@ int c, size; + int bracount = 0; + int brastack[200]; + int top_backref = 0; ++BOOL capturing; + unsigned int brastackptr = 0; + uschar *code; + const uschar *ptr; +@@ -2445,7 +2463,8 @@ while ((c = *(++ptr)) != 0) + /* Brackets may be genuine groups or special things */ + + case '(': +- ++ capturing = FALSE; ++ + /* Handle special forms of bracket, which all start (? */ + + if (ptr[1] == '?') switch (c = ptr[2]) +@@ -2541,11 +2560,16 @@ while ((c = *(++ptr)) != 0) + } + continue; /* End of this bracket handling */ + } ++ ++ /* Ordinary parentheses, not followed by '?', are capturing unless ++ PCRE_NO_AUTO_CAPTURE is set. */ + ++ else capturing = (options & PCRE_NO_AUTO_CAPTURE) == 0; ++ + /* Extracting brackets must be counted so we can process escapes in a + Perlish way. */ +- +- else bracount++; ++ ++ if (capturing) bracount++; + + /* Non-special forms of bracket. Save length for computing whole length + at end if there's a repeat that requires duplication of the group. */ |