summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2015-11-29 17:38:25 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2015-11-29 17:38:25 +0000
commit108377b836fc29a84f5286287629d96549b1c777 (patch)
tree2edc0d6b73f692242dde327e17af9da0ad3f34f4
parentbfc1dfa660c24dc7a75108d934290e50d7db2719 (diff)
downloadpcre-108377b836fc29a84f5286287629d96549b1c777.tar.gz
Give error for regexec with pmatch=NULL and REG_STARTEND set.
git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1614 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--ChangeLog3
-rw-r--r--pcreposix.c1
2 files changed, 4 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 405f156..cfa7066 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,6 +17,9 @@ Version 8.39 xx-xxxxxx-201x
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
diff --git a/pcreposix.c b/pcreposix.c
index f024423..dcc13ef 100644
--- a/pcreposix.c
+++ b/pcreposix.c
@@ -364,6 +364,7 @@ start location rather than being passed as a PCRE "starting offset". */
if ((eflags & REG_STARTEND) != 0)
{
+ if (pmatch == NULL) return REG_INVARG;
so = pmatch[0].rm_so;
eo = pmatch[0].rm_eo;
}