lol

Merge #30963: pcre: security 8.40 -> 8.41

+2 -56
-52
pkgs/development/libraries/pcre/CVE-2017-7186.patch
··· 1 - --- a/pcre_internal.h 2016/05/21 13:34:44 1649 2 - +++ b/pcre_internal.h 2017/02/24 17:30:30 1688 3 - @@ -2772,6 +2772,9 @@ 4 - extern const pcre_uint16 PRIV(ucd_stage2)[]; 5 - extern const pcre_uint32 PRIV(ucp_gentype)[]; 6 - extern const pcre_uint32 PRIV(ucp_gbtable)[]; 7 - +#ifdef COMPILE_PCRE32 8 - +extern const ucd_record PRIV(dummy_ucd_record)[]; 9 - +#endif 10 - #ifdef SUPPORT_JIT 11 - extern const int PRIV(ucp_typerange)[]; 12 - #endif 13 - @@ -2780,9 +2783,15 @@ 14 - /* UCD access macros */ 15 - 16 - #define UCD_BLOCK_SIZE 128 17 - -#define GET_UCD(ch) (PRIV(ucd_records) + \ 18 - +#define REAL_GET_UCD(ch) (PRIV(ucd_records) + \ 19 - PRIV(ucd_stage2)[PRIV(ucd_stage1)[(int)(ch) / UCD_BLOCK_SIZE] * \ 20 - UCD_BLOCK_SIZE + (int)(ch) % UCD_BLOCK_SIZE]) 21 - + 22 - +#ifdef COMPILE_PCRE32 23 - +#define GET_UCD(ch) ((ch > 0x10ffff)? PRIV(dummy_ucd_record) : REAL_GET_UCD(ch)) 24 - +#else 25 - +#define GET_UCD(ch) REAL_GET_UCD(ch) 26 - +#endif 27 - 28 - #define UCD_CHARTYPE(ch) GET_UCD(ch)->chartype 29 - #define UCD_SCRIPT(ch) GET_UCD(ch)->script 30 - --- a/pcre_ucd.c 2014/06/19 07:51:39 1490 31 - +++ b/pcre_ucd.c 2017/02/24 17:30:30 1688 32 - @@ -38,6 +38,20 @@ 33 - const pcre_uint32 PRIV(ucd_caseless_sets)[] = {0}; 34 - #else 35 - 36 - +/* If the 32-bit library is run in non-32-bit mode, character values 37 - +greater than 0x10ffff may be encountered. For these we set up a 38 - +special record. */ 39 - + 40 - +#ifdef COMPILE_PCRE32 41 - +const ucd_record PRIV(dummy_ucd_record)[] = {{ 42 - + ucp_Common, /* script */ 43 - + ucp_Cn, /* type unassigned */ 44 - + ucp_gbOther, /* grapheme break property */ 45 - + 0, /* case set */ 46 - + 0, /* other case */ 47 - + }}; 48 - +#endif 49 - + 50 - /* When recompiling tables with a new Unicode version, please check the 51 - types in this structure definition from pcre_internal.h (the actual 52 - field names will be different):
+2 -4
pkgs/development/libraries/pcre/default.nix
··· 9 9 assert elem variant [ null "cpp" "pcre16" "pcre32" ]; 10 10 11 11 let 12 - version = "8.40"; 12 + version = "8.41"; 13 13 pname = if (variant == null) then "pcre" 14 14 else if (variant == "cpp") then "pcre-cpp" 15 15 else variant; ··· 19 19 20 20 src = fetchurl { 21 21 url = "ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-${version}.tar.bz2"; 22 - sha256 = "1x7lpjn7jhk0n3sdvggxrlrhab8kkfjwl7qix0ypw9nlx8lpmqh0"; 22 + sha256 = "0c5m469p5pd7jip621ipq6hbgh7128lzh7xndllfgh77ban7wb76"; 23 23 }; 24 24 25 25 outputs = [ "bin" "dev" "out" "doc" "man" ]; ··· 30 30 "--disable-cpp" 31 31 ] 32 32 ++ optional (variant != null) "--enable-${variant}"; 33 - 34 - patches = [ ./CVE-2017-7186.patch ]; 35 33 36 34 buildInputs = optional (hostPlatform.libc == "msvcrt") windows.mingw_w64_pthreads; 37 35