[Midnightbsd-cvs] mports [19498] trunk/devel/pcre: pcre 8.37

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun Jun 21 11:13:31 EDT 2015


Revision: 19498
          http://svnweb.midnightbsd.org/mports/?rev=19498
Author:   laffer1
Date:     2015-06-21 11:13:31 -0400 (Sun, 21 Jun 2015)
Log Message:
-----------
pcre 8.37

Modified Paths:
--------------
    trunk/devel/pcre/Makefile
    trunk/devel/pcre/distinfo
    trunk/devel/pcre/pkg-plist

Added Paths:
-----------
    trunk/devel/pcre/files/
    trunk/devel/pcre/files/patch-buffer-overflow

Modified: trunk/devel/pcre/Makefile
===================================================================
--- trunk/devel/pcre/Makefile	2015-06-21 15:09:49 UTC (rev 19497)
+++ trunk/devel/pcre/Makefile	2015-06-21 15:13:31 UTC (rev 19498)
@@ -1,37 +1,39 @@
 # $MidnightBSD$
 
 PORTNAME=	pcre
-PORTVERSION=	8.35
+PORTVERSION=	8.37
 CATEGORIES=	devel
 MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/${PORTVERSION} \
-		ftp://ftp.csx.cam.ac.uk/pub/software/programming/%SUBDIR%/ \
-		ftp://ftp.fu-berlin.de/unix/misc/%SUBDIR%/ \
-		ftp://ftp.tin.org/pub/libs/%SUBDIR%/
-MASTER_SITE_SUBDIR=${PORTNAME}
+		ftp://ftp.csx.cam.ac.uk/pub/software/programming/${PORTNAME}/ \
+		ftp://ftp.fu-berlin.de/unix/misc/${PORTNAME}/ \
+		ftp://ftp.tin.org/pub/libs/${PORTNAME}/
 
 MAINTAINER=	ports at MidnightBSD.org
 COMMENT=	Perl Compatible Regular Expressions library
 
 LICENSE=	bsd3
+LICENSE_FILE=	${WRKSRC}/LICENCE
 
 GNU_CONFIGURE=	yes
+USES=		libtool pathfix tar:bzip2
 USE_LDCONFIG=	yes
-USES=	pathfix tar:bzip2
 CONFIGURE_ARGS=	--enable-utf --enable-unicode-properties \
 		--enable-pcre8 --enable-pcre16 --enable-pcre32
+INSTALL_TARGET=	install-strip
 
-OPTIONS_DEFINE=		STACK_RECURSION
+OPTIONS_DEFINE=		DOCS LIBEDIT READLINE STACK_RECURSION
 OPTIONS_DEFAULT=	STACK_RECURSION
 
 STACK_RECURSION_DESC=	Use the stack for recursion during matching
 
+LIBEDIT_CONFIGURE_ENABLE=	pcretest-libedit
+
+READLINE_USES=			readline
+READLINE_CONFIGURE_ENABLE=	pcretest-libreadline
+
 .include <bsd.mport.options.mk>
 
-.if ${ARCH} != "sparc64"
 CONFIGURE_ARGS+=	--enable-jit
-.else
-CONFIGURE_ARGS+=	--disable-jit
-.endif
 
 .if ${PORT_OPTIONS:MDOCS}
 PORTDOCS=	*
@@ -43,15 +45,11 @@
 CONFIGURE_ARGS+=	--disable-stack-for-recursion
 .endif
 
-# For FreeBSD 8.3 and above link pcretest against libedit
-.if ${OSVERSION} >= 803000
-CONFIGURE_ARGS+=	--enable-pcretest-libedit
+# libedit
+.if ${PORT_OPTIONS:MLIBEDIT}
+CFLAGS+=	-I /usr/include/edit
 .endif
 
-.if ${ARCH} == "amd64"
-CFLAGS+=	-fPIC
-.endif
-
 # Optional knobs that accept positive integer parameters (see pcrebuild(3)):
 
 # Allow the use of very large patterns (> 64K) with the 8- and 16-bit
@@ -73,6 +71,12 @@
 CONFIGURE_ARGS+=	--with-match-limit-recursion=${WITH_MATCH_LIMIT_RECURSION}
 .endif
 
+# Control PCRE resource use by limiting the nesting depth of parentheses in
+# patterns compiled with pcre_compile() (default: 250):
+.if defined(WITH_PARENS_NEST_LIMIT)
+CONFIGURE_ARGS+=	--with-parens-nest-limit=${WITH_PARENS_NEST_LIMIT}
+.endif
+
 # Adjust the default maximum number of substrings that will be stored on the stack
 # when the 8-bit library is called via the POSIX interface (default: 10):
 .if defined(WITH_POSIX_MALLOC_THRESHOLD)
@@ -80,18 +84,13 @@
 .endif
 
 post-patch:
+	@${REINPLACE_CMD} -e "/^\.rs/d" ${WRKSRC}/doc/*.3 ${WRKSRC}/doc/*.1
+	@${REINPLACE_CMD} -e "s/£//g" ${WRKSRC}/doc/pcre_compile2.3
 .if !${PORT_OPTIONS:MDOCS}
 	@${REINPLACE_CMD} -E -e '/^install-data-am/,/^$$/ s,install-(dist_doc|dist_html|html)DATA,,g' \
 		${WRKSRC}/Makefile.in
 .endif
-	${REINPLACE_CMD} -e 's/\(pkgconfigdir = \).*/\1$$\(prefix\)\/libdata\/pkgconfig/' \
-		${WRKSRC}/Makefile.in
-# work around for a autoconf assumption, to fix c++ linking with clang
-	@${REINPLACE_CMD} -e 's|GREP "\\-L"|GREP "conftest\\.$$objext"|g' ${WRKSRC}/configure
 
-post-install:
-	@${STRIP_CMD} ${PREFIX}/bin/pcregrep ${PREFIX}/bin/pcretest
-
 #prevent regression test coredumps from causing failures on the
 #package-building cluster:
 .ifndef(MAINTAINER_MODE)
@@ -100,9 +99,12 @@
 TESTLOGS?=	RunGrepTest RunTest pcre_jit_test pcre_scanner_unittest \
 		pcre_stringpiece_unittest pcrecpp_unittest
 
+post-install:
+	${LN} -s libpcre.so.1 ${PREFIX}/lib/libpcre.so.3
+
 check regression-test test: build
 	@cd ${WRKSRC} ; \
-	${SETENV} ${MAKE_ENV} ${CORELIMIT} ${MAKE} ${MAKE_ARGS} check ; \
+	${SETENV} ${MAKE_ENV} ${CORELIMIT} ${MAKE_CMD} ${MAKE_ARGS} check ; \
 	for _l in ${TESTLOGS} ; do if ${TEST} -f $${_l}.log ; then \
 	${PRINTF} "\n\n$${_l}.log\n\n\n" ; ${CAT} $${_l}.log ; fi ; done
 

Modified: trunk/devel/pcre/distinfo
===================================================================
--- trunk/devel/pcre/distinfo	2015-06-21 15:09:49 UTC (rev 19497)
+++ trunk/devel/pcre/distinfo	2015-06-21 15:13:31 UTC (rev 19498)
@@ -1,2 +1,2 @@
-SHA256 (pcre-8.35.tar.bz2) = a961c1c78befef263cc130756eeca7b674b4e73a81533293df44e4265236865b
-SIZE (pcre-8.35.tar.bz2) = 1522220
+SHA256 (pcre-8.37.tar.bz2) = 51679ea8006ce31379fb0860e46dd86665d864b5020fc9cd19e71260eef4789d
+SIZE (pcre-8.37.tar.bz2) = 1557603

Added: trunk/devel/pcre/files/patch-buffer-overflow
===================================================================
--- trunk/devel/pcre/files/patch-buffer-overflow	                        (rev 0)
+++ trunk/devel/pcre/files/patch-buffer-overflow	2015-06-21 15:13:31 UTC (rev 19498)
@@ -0,0 +1,296 @@
+--- pcre_compile.c.orig	2015-04-13 15:54:01 UTC
++++ pcre_compile.c
+@@ -1799,7 +1799,7 @@ for (;;)
+     case OP_ASSERTBACK:
+     case OP_ASSERTBACK_NOT:
+     do cc += GET(cc, 1); while (*cc == OP_ALT);
+-    cc += PRIV(OP_lengths)[*cc];
++    cc += 1 + LINK_SIZE;
+     break;
+ 
+     /* Skip over things that don't match chars */
+@@ -3985,11 +3985,12 @@ have their offsets adjusted. That one of
+ is called, the partially compiled regex must be temporarily terminated with
+ OP_END.
+ 
+-This function has been extended with the possibility of forward references for
+-recursions and subroutine calls. It must also check the list of such references
+-for the group we are dealing with. If it finds that one of the recursions in
+-the current group is on this list, it adjusts the offset in the list, not the
+-value in the reference (which is a group number).
++This function has been extended to cope with forward references for recursions
++and subroutine calls. It must check the list of such references for the
++group we are dealing with. If it finds that one of the recursions in the
++current group is on this list, it does not adjust the value in the reference
++(which is a group number). After the group has been scanned, all the offsets in
++the forward reference list for the group are adjusted.
+ 
+ Arguments:
+   group      points to the start of the group
+@@ -4005,29 +4006,21 @@ static void
+ adjust_recurse(pcre_uchar *group, int adjust, BOOL utf, compile_data *cd,
+   size_t save_hwm_offset)
+ {
++int offset;
++pcre_uchar *hc;
+ pcre_uchar *ptr = group;
+ 
+ while ((ptr = (pcre_uchar *)find_recurse(ptr, utf)) != NULL)
+   {
+-  int offset;
+-  pcre_uchar *hc;
+-
+-  /* See if this recursion is on the forward reference list. If so, adjust the
+-  reference. */
+-
+   for (hc = (pcre_uchar *)cd->start_workspace + save_hwm_offset; hc < cd->hwm;
+        hc += LINK_SIZE)
+     {
+     offset = (int)GET(hc, 0);
+-    if (cd->start_code + offset == ptr + 1)
+-      {
+-      PUT(hc, 0, offset + adjust);
+-      break;
+-      }
++    if (cd->start_code + offset == ptr + 1) break;
+     }
+ 
+-  /* Otherwise, adjust the recursion offset if it's after the start of this
+-  group. */
++  /* If we have not found this recursion on the forward reference list, adjust
++  the recursion's offset if it's after the start of this group. */
+ 
+   if (hc >= cd->hwm)
+     {
+@@ -4037,6 +4030,15 @@ while ((ptr = (pcre_uchar *)find_recurse
+ 
+   ptr += 1 + LINK_SIZE;
+   }
++
++/* Now adjust all forward reference offsets for the group. */
++
++for (hc = (pcre_uchar *)cd->start_workspace + save_hwm_offset; hc < cd->hwm;
++     hc += LINK_SIZE)
++  {
++  offset = (int)GET(hc, 0);
++  PUT(hc, 0, offset + adjust);
++  }
+ }
+ 
+ 
+@@ -4465,7 +4467,7 @@ const pcre_uchar *tempptr;
+ const pcre_uchar *nestptr = NULL;
+ pcre_uchar *previous = NULL;
+ pcre_uchar *previous_callout = NULL;
+-size_t save_hwm_offset = 0;
++size_t item_hwm_offset = 0;
+ pcre_uint8 classbits[32];
+ 
+ /* We can fish out the UTF-8 setting once and for all into a BOOL, but we
+@@ -4767,6 +4769,7 @@ for (;; ptr++)
+     zeroreqchar = reqchar;
+     zeroreqcharflags = reqcharflags;
+     previous = code;
++    item_hwm_offset = cd->hwm - cd->start_workspace;
+     *code++ = ((options & PCRE_DOTALL) != 0)? OP_ALLANY: OP_ANY;
+     break;
+ 
+@@ -4818,6 +4821,7 @@ for (;; ptr++)
+     /* Handle a real character class. */
+ 
+     previous = code;
++    item_hwm_offset = cd->hwm - cd->start_workspace;
+ 
+     /* PCRE supports POSIX class stuff inside a class. Perl gives an error if
+     they are encountered at the top level, so we'll do that too. */
+@@ -5930,7 +5934,7 @@ for (;; ptr++)
+       {
+       register int i;
+       int len = (int)(code - previous);
+-      size_t base_hwm_offset = save_hwm_offset;
++      size_t base_hwm_offset = item_hwm_offset;
+       pcre_uchar *bralink = NULL;
+       pcre_uchar *brazeroptr = NULL;
+ 
+@@ -5985,7 +5989,7 @@ for (;; ptr++)
+         if (repeat_max <= 1)    /* Covers 0, 1, and unlimited */
+           {
+           *code = OP_END;
+-          adjust_recurse(previous, 1, utf, cd, save_hwm_offset);
++          adjust_recurse(previous, 1, utf, cd, item_hwm_offset);
+           memmove(previous + 1, previous, IN_UCHARS(len));
+           code++;
+           if (repeat_max == 0)
+@@ -6009,7 +6013,7 @@ for (;; ptr++)
+           {
+           int offset;
+           *code = OP_END;
+-          adjust_recurse(previous, 2 + LINK_SIZE, utf, cd, save_hwm_offset);
++          adjust_recurse(previous, 2 + LINK_SIZE, utf, cd, item_hwm_offset);
+           memmove(previous + 2 + LINK_SIZE, previous, IN_UCHARS(len));
+           code += 2 + LINK_SIZE;
+           *previous++ = OP_BRAZERO + repeat_type;
+@@ -6267,7 +6271,7 @@ for (;; ptr++)
+               {
+               int nlen = (int)(code - bracode);
+               *code = OP_END;
+-              adjust_recurse(bracode, 1 + LINK_SIZE, utf, cd, save_hwm_offset);
++              adjust_recurse(bracode, 1 + LINK_SIZE, utf, cd, item_hwm_offset);
+               memmove(bracode + 1 + LINK_SIZE, bracode, IN_UCHARS(nlen));
+               code += 1 + LINK_SIZE;
+               nlen += 1 + LINK_SIZE;
+@@ -6401,7 +6405,7 @@ for (;; ptr++)
+         else
+           {
+           *code = OP_END;
+-          adjust_recurse(tempcode, 1 + LINK_SIZE, utf, cd, save_hwm_offset);
++          adjust_recurse(tempcode, 1 + LINK_SIZE, utf, cd, item_hwm_offset);
+           memmove(tempcode + 1 + LINK_SIZE, tempcode, IN_UCHARS(len));
+           code += 1 + LINK_SIZE;
+           len += 1 + LINK_SIZE;
+@@ -6450,7 +6454,7 @@ for (;; ptr++)
+ 
+         default:
+         *code = OP_END;
+-        adjust_recurse(tempcode, 1 + LINK_SIZE, utf, cd, save_hwm_offset);
++        adjust_recurse(tempcode, 1 + LINK_SIZE, utf, cd, item_hwm_offset);
+         memmove(tempcode + 1 + LINK_SIZE, tempcode, IN_UCHARS(len));
+         code += 1 + LINK_SIZE;
+         len += 1 + LINK_SIZE;
+@@ -6623,7 +6627,7 @@ for (;; ptr++)
+     newoptions = options;
+     skipbytes = 0;
+     bravalue = OP_CBRA;
+-    save_hwm_offset = cd->hwm - cd->start_workspace;
++    item_hwm_offset = cd->hwm - cd->start_workspace;
+     reset_bracount = FALSE;
+ 
+     /* Deal with the extended parentheses; all are introduced by '?', and the
+@@ -6769,7 +6773,7 @@ for (;; ptr++)
+             ptr++;
+             }
+           namelen = (int)(ptr - name);
+-          if (lengthptr != NULL) *lengthptr += IMM2_SIZE;
++          if (lengthptr != NULL) skipbytes += IMM2_SIZE;
+           }
+ 
+         /* Check the terminator */
+@@ -7173,14 +7177,26 @@ for (;; ptr++)
+           number. If the name is not found, set the value to 0 for a forward
+           reference. */
+ 
++          recno = 0;
+           ng = cd->named_groups;
+           for (i = 0; i < cd->names_found; i++, ng++)
+             {
+             if (namelen == ng->length &&
+                 STRNCMP_UC_UC(name, ng->name, namelen) == 0)
+-              break;
++              {
++              open_capitem *oc;
++              recno = ng->number;
++              if (is_recurse) break;
++              for (oc = cd->open_caps; oc != NULL; oc = oc->next)
++                {
++                if (oc->number == recno)
++                  {
++                  oc->flag = TRUE;
++                  break;
++                  }
++                }
++              }
+             }
+-          recno = (i < cd->names_found)? ng->number : 0;
+ 
+           /* Count named back references. */
+ 
+@@ -7191,6 +7207,19 @@ for (;; ptr++)
+           16-bit data item. */
+ 
+           *lengthptr += IMM2_SIZE;
++
++          /* If this is a forward reference and we are within a (?|...) group,
++          the reference may end up as the number of a group which we are
++          currently inside, that is, it could be a recursive reference. In the
++          real compile this will be picked up and the reference wrapped with
++          OP_ONCE to make it atomic, so we must space in case this occurs. */
++
++          /* In fact, this can happen for a non-forward reference because
++          another group with the same number might be created later. This
++          issue is fixed "properly" in PCRE2. As PCRE1 is now in maintenance
++          only mode, we finesse the bug by allowing more memory always. */
++
++          /* if (recno == 0) */ *lengthptr += 2 + 2*LINK_SIZE;
+           }
+ 
+         /* In the real compile, search the name table. We check the name
+@@ -7247,6 +7276,7 @@ for (;; ptr++)
+             {
+             if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE;
+             previous = code;
++            item_hwm_offset = cd->hwm - cd->start_workspace;
+             *code++ = ((options & PCRE_CASELESS) != 0)? OP_DNREFI : OP_DNREF;
+             PUT2INC(code, 0, index);
+             PUT2INC(code, 0, count);
+@@ -7360,6 +7390,7 @@ for (;; ptr++)
+           HANDLE_RECURSION:
+ 
+           previous = code;
++          item_hwm_offset = cd->hwm - cd->start_workspace;
+           called = cd->start_code;
+ 
+           /* When we are actually compiling, find the bracket that is being
+@@ -7561,7 +7592,11 @@ for (;; ptr++)
+       previous = NULL;
+       cd->iscondassert = FALSE;
+       }
+-    else previous = code;
++    else
++      {
++      previous = code;
++      item_hwm_offset = cd->hwm - cd->start_workspace;
++      }
+ 
+     *code = bravalue;
+     tempcode = code;
+@@ -7809,7 +7844,7 @@ for (;; ptr++)
+         const pcre_uchar *p;
+         pcre_uint32 cf;
+ 
+-        save_hwm_offset = cd->hwm - cd->start_workspace;   /* Normally this is set when '(' is read */
++        item_hwm_offset = cd->hwm - cd->start_workspace;   /* Normally this is set when '(' is read */
+         terminator = (*(++ptr) == CHAR_LESS_THAN_SIGN)?
+           CHAR_GREATER_THAN_SIGN : CHAR_APOSTROPHE;
+ 
+@@ -7877,6 +7912,7 @@ for (;; ptr++)
+         HANDLE_REFERENCE:
+         if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE;
+         previous = code;
++        item_hwm_offset = cd->hwm - cd->start_workspace;
+         *code++ = ((options & PCRE_CASELESS) != 0)? OP_REFI : OP_REF;
+         PUT2INC(code, 0, recno);
+         cd->backref_map |= (recno < 32)? (1 << recno) : 1;
+@@ -7906,6 +7942,7 @@ for (;; ptr++)
+         if (!get_ucp(&ptr, &negated, &ptype, &pdata, errorcodeptr))
+           goto FAILED;
+         previous = code;
++        item_hwm_offset = cd->hwm - cd->start_workspace;
+         *code++ = ((escape == ESC_p) != negated)? OP_PROP : OP_NOTPROP;
+         *code++ = ptype;
+         *code++ = pdata;
+@@ -7946,6 +7983,7 @@ for (;; ptr++)
+ 
+           {
+           previous = (escape > ESC_b && escape < ESC_Z)? code : NULL;
++          item_hwm_offset = cd->hwm - cd->start_workspace;
+           *code++ = (!utf && escape == ESC_C)? OP_ALLANY : escape;
+           }
+         }
+@@ -7989,6 +8027,7 @@ for (;; ptr++)
+ 
+     ONE_CHAR:
+     previous = code;
++    item_hwm_offset = cd->hwm - cd->start_workspace;
+ 
+     /* For caseless UTF-8 mode when UCP support is available, check whether
+     this character has more than one other case. If so, generate a special


Property changes on: trunk/devel/pcre/files/patch-buffer-overflow
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Modified: trunk/devel/pcre/pkg-plist
===================================================================
--- trunk/devel/pcre/pkg-plist	2015-06-21 15:09:49 UTC (rev 19497)
+++ trunk/devel/pcre/pkg-plist	2015-06-21 15:13:31 UTC (rev 19498)
@@ -8,25 +8,26 @@
 include/pcrecpparg.h
 include/pcrecpp.h
 lib/libpcre.a
-lib/libpcre.la
 lib/libpcre.so
+lib/libpcre.so.1
+lib/libpcre.so.1.2.5
 lib/libpcre.so.3
 lib/libpcre16.a
-lib/libpcre16.la
 lib/libpcre16.so
-lib/libpcre16.so.2
+lib/libpcre16.so.0
+lib/libpcre16.so.0.2.5
 lib/libpcre32.a
-lib/libpcre32.la
 lib/libpcre32.so
 lib/libpcre32.so.0
+lib/libpcre32.so.0.0.5
 lib/libpcrecpp.a
-lib/libpcrecpp.la
 lib/libpcrecpp.so
 lib/libpcrecpp.so.0
+lib/libpcrecpp.so.0.0.1
 lib/libpcreposix.a
-lib/libpcreposix.la
 lib/libpcreposix.so
 lib/libpcreposix.so.0
+lib/libpcreposix.so.0.0.3
 libdata/pkgconfig/libpcre.pc
 libdata/pkgconfig/libpcre16.pc
 libdata/pkgconfig/libpcre32.pc



More information about the Midnightbsd-cvs mailing list