[Pcre-svn] [1614] code/trunk: Give error for regexec with pm…

Top Page
Delete this message
Author: Subversion repository
Date:  
To: pcre-svn
Subject: [Pcre-svn] [1614] code/trunk: Give error for regexec with pmatch= NULL and REG_STARTEND set.
Revision: 1614
          http://vcs.pcre.org/viewvc?view=rev&revision=1614
Author:   ph10
Date:     2015-11-29 17:38:25 +0000 (Sun, 29 Nov 2015)
Log Message:
-----------
Give error for regexec with pmatch=NULL and REG_STARTEND set.


Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/pcreposix.c


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2015-11-27 17:41:04 UTC (rev 1613)
+++ code/trunk/ChangeLog    2015-11-29 17:38:25 UTC (rev 1614)
@@ -17,6 +17,9 @@


 3.  Further to 8.38/46, negated classes such as [^[:^ascii:]\d] were also not 
     working correctly in UCP mode.
+    
+4.  The POSIX wrapper function regexec() crashed if the option REG_STARTEND
+    was set when the pmatch argument was NULL. It now returns REG_INVARG.



Version 8.38 23-November-2015

Modified: code/trunk/pcreposix.c
===================================================================
--- code/trunk/pcreposix.c    2015-11-27 17:41:04 UTC (rev 1613)
+++ code/trunk/pcreposix.c    2015-11-29 17:38:25 UTC (rev 1614)
@@ -364,6 +364,7 @@


if ((eflags & REG_STARTEND) != 0)
{
+ if (pmatch == NULL) return REG_INVARG;
so = pmatch[0].rm_so;
eo = pmatch[0].rm_eo;
}